Background transparency in libgdx

前端 未结 2 1589
悲哀的现实
悲哀的现实 2020-12-18 12:30

How can I make background of screen transparent if I use libgdx in Android?

The code I tried to use doesn\'t work.

Gdx.gl.glClearColor( 0, 0, 0, 0 );         


        
2条回答
  •  不知归路
    2020-12-18 12:47

    Think it this way - transparency is visible when you have at least two things. If you have a black background and then draw a white one on top of it with transparency say 50%, you will see black background through your white layer. Now, at the start you have the screen. It can be of any color. Under that screen, there's nothing. So, if you need transparency, draw something on top of it with alpha channel.

提交回复
热议问题