01 Getting started
Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Once you have a set of images, you can animated them with a
graphicEntityModule.createSpriteAnimation() .setImages(heroSprites) .setX(hero.getX()) .setY(hero.getY()) .setDuration(2000) .setLoop(true) .setStarted(true);
setImages(heroSprites): set a
Stringarray containing the filenames of the sprites.
setY(hero.getY()): set the position.
setDuration(2000): set how long the whole animation takes to be played (in milliseconds).
setLoop(true): if true, the animation will repeat. Otherwise, it will be played only once and the last sprite will remain displayed.
setStarted(true): if true, the animation plays. Otherwise, none of the sprites are displayed.
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content