3 added 680 characters in body
source | link

Have you tried a newer version of LibGDX? Support for GL 1 was removed a while ago so it seems that you're using an old version. It might fix the problem. If that doesn't work, can you show the rest of your code?

Edit: Oh, and maybe change GL10.GL_COLOR_BUFFER_BIT to GL20.GL_COLOR_BUFFER_BIT Edit2

Edit2: Okay, I noticed a few other things you can try. First, I think that the buffer bit part has to go before glClearColor(), not after. Second, when setting the color of backgroud you might try it with an alpha value of 1.0 and not 0.4, not sure why you would want to do that since you clear the screen beforehand so it won't be see through anyway.

Edit3: Last thing: you forgot to set the camera of the batch(es) it seems. Create a class variable "private OrthographicCamera camera;" in your class, and in the create function initialize it with "camera = new OrthographicCamera()". Paste this line afterwards: "camera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());". What this does is it initializes a camera and sets the bottom left of the screen to (0,0). Now you just have to initialize the batch before calling batch.begin(). Paste this before batch.begin(): "batch.setProjectionMatrix(camera.combined);" Take a look in the docs at the pages about cameras and spritebatches for more information. Also, I think you also have to do this for the backgroud variable, but you can probably figure that out yourself ;-)

Have you tried a newer version of LibGDX? Support for GL 1 was removed a while ago so it seems that you're using an old version. It might fix the problem. If that doesn't work, can you show the rest of your code?

Edit: Oh, and maybe change GL10.GL_COLOR_BUFFER_BIT to GL20.GL_COLOR_BUFFER_BIT Edit2: Okay, I noticed a few other things you can try. First, I think that the buffer bit part has to go before glClearColor(), not after. Second, when setting the color of backgroud you might try it with an alpha value of 1.0 and not 0.4, not sure why you would want to do that since you clear the screen beforehand so it won't be see through anyway.

Have you tried a newer version of LibGDX? Support for GL 1 was removed a while ago so it seems that you're using an old version. It might fix the problem. If that doesn't work, can you show the rest of your code?

Edit: Oh, and maybe change GL10.GL_COLOR_BUFFER_BIT to GL20.GL_COLOR_BUFFER_BIT

Edit2: Okay, I noticed a few other things you can try. First, I think that the buffer bit part has to go before glClearColor(), not after. Second, when setting the color of backgroud you might try it with an alpha value of 1.0 and not 0.4, not sure why you would want to do that since you clear the screen beforehand so it won't be see through anyway.

Edit3: Last thing: you forgot to set the camera of the batch(es) it seems. Create a class variable "private OrthographicCamera camera;" in your class, and in the create function initialize it with "camera = new OrthographicCamera()". Paste this line afterwards: "camera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());". What this does is it initializes a camera and sets the bottom left of the screen to (0,0). Now you just have to initialize the batch before calling batch.begin(). Paste this before batch.begin(): "batch.setProjectionMatrix(camera.combined);" Take a look in the docs at the pages about cameras and spritebatches for more information. Also, I think you also have to do this for the backgroud variable, but you can probably figure that out yourself ;-)

2 added 353 characters in body
source | link

Have you tried a newer version of LibGDX? Support for GL 1 was removed a while ago so it seems that you're using an old version. It might fix the problem. If that doesn't work, can you show the rest of your code?

EDITEdit: Oh, and maybe change GL10.GL_COLOR_BUFFER_BIT to GL20.GL_COLOR_BUFFER_BIT Edit2: Okay, I noticed a few other things you can try. First, I think that the buffer bit part has to go before glClearColor(), not after. Second, when setting the color of backgroud you might try it with an alpha value of 1.0 and not 0.4, not sure why you would want to do that since you clear the screen beforehand so it won't be see through anyway.

Have you tried a newer version of LibGDX? Support for GL 1 was removed a while ago so it seems that you're using an old version. It might fix the problem. If that doesn't work, can you show the rest of your code?

EDIT: Oh, and maybe change GL10.GL_COLOR_BUFFER_BIT to GL20.GL_COLOR_BUFFER_BIT

Have you tried a newer version of LibGDX? Support for GL 1 was removed a while ago so it seems that you're using an old version. It might fix the problem. If that doesn't work, can you show the rest of your code?

Edit: Oh, and maybe change GL10.GL_COLOR_BUFFER_BIT to GL20.GL_COLOR_BUFFER_BIT Edit2: Okay, I noticed a few other things you can try. First, I think that the buffer bit part has to go before glClearColor(), not after. Second, when setting the color of backgroud you might try it with an alpha value of 1.0 and not 0.4, not sure why you would want to do that since you clear the screen beforehand so it won't be see through anyway.

1
source | link

Have you tried a newer version of LibGDX? Support for GL 1 was removed a while ago so it seems that you're using an old version. It might fix the problem. If that doesn't work, can you show the rest of your code?

EDIT: Oh, and maybe change GL10.GL_COLOR_BUFFER_BIT to GL20.GL_COLOR_BUFFER_BIT