Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Andengine fade in/out and alpha modifiers not working

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?

like image 374
Jonas Peteraitis Avatar asked Mar 11 '12 15:03

Jonas Peteraitis


1 Answers

Did you set the blend function properly? Example:

sprite.setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
like image 79
JohnEye Avatar answered Oct 19 '22 22:10

JohnEye