Answer the question
In order to leave comments, you need to log in
How to fill with semi-alpha in libGDX?
I need to fill the screen with a translucent color, for example, in order to darken the previous frame.
I tried to do it like this:
Gdx.gl.glClearColor(1, 0, 0, 0.5f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
Answer the question
In order to leave comments, you need to log in
I could be wrong, but it seems that using glClear for such purposes is not exactly 'pretty' and does not always work with default settings.
In your case, it would be more correct to draw a rectangle on the entire screen and already control its color.
1. glClearColor will fill the color buffer with the value that you pass there, why do you think that there will be something left from the previous one?
2. Make a billboard (well, a quad, perpendicular to the camera) in full screen, put it in z before your picture, fill it with alpha, turn on blend
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question