Search code examples
delayandengineanimated

How to delay an animated sprite in Andengine?


I have an animated Sprite that is drawn on the screen when I press the button. However, I want to the animation to start after 5 seconds. Technically, the ver first PNG in the "animation set" is shown and the animation starts after 5 seconds.

I have tried to used the DelayModifier as follows, but without luck:

mySprite.registerEntityModifier(new DelayModifier(500)); //doesn't work

I would appreciate your input.


Solution

  • I found the solution to my problem from this tutorial: http://www.andengine.org/forums/tutorials/using-timer-s-sprite-spawn-example-t463.html

    The idea was to use a TimeHandler and not a DelayModifier.