Answer the question
In order to leave comments, you need to log in
AlphaModifier on click on sprite (Andengine)?
Hello dear!
I'm trying to program smooth scene switching on Andengine like in "Cut The Rope".
All my code works (with the Back button, for example) except for clicking on the sprite (button in the app).
I am using the following code:
AnimatedSprite Start = new AnimatedSprite(205, 440,
BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(ScreenTexture1, GameActivity.context,
"gfx/image0001.png", 500, 0, 1, 2)) {
@Override
public boolean onAreaTouched(final TouchEvent pSceneTouchEvent,
final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_DOWN) {
this.nextTile();
}
if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_UP) {
this.nextTile();
GameScenes.change(1);
}
return true;
}
};
c = casper; // Это просто спрайт для AlphaModifier
new Thread() {
public void run() {
c.registerEntityModifier(new AlphaModifier(3.2f, 1f, 0f));
}
}.run();
pause(3200);
return false;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question