Andengine fade in/out and alpha modifiers not working

Jonas Peteraitis picture Jonas Peteraitis · Mar 11, 2012 · Viewed 7.1k times · Source

I have a problem with AndEngine GLES2.

I have this code:

Sprite black = new Sprite(0,0, blackRegion, this.getVertexBufferObjectManager());
black.setSize(CAMERA_WIDTH, CAMERA_HEIGHT);

black.registerEntityModifier(new AlphaModifier(2, 0, 255));

mScene.attachChild(black);

So it's not working. Nothing does...

What do I need to do?

Answer

JohnEye picture JohnEye · Mar 12, 2012

Did you set the blend function properly? Example:

sprite.setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);