File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,24 @@ String[] seaweedSprites = graphicEntityModule.createSpriteSheetSplitter()
2626 .setImagesPerRow(4 )
2727 .setName(" seaweed" )
2828 .split();
29+
30+ // Creating an animation from the splitted spritesheet
31+ graphicEntityModule. createSpriteAnimation()
32+ .setImages(seaweedSprites)
33+ .setX(50 )
34+ .setY(50 )
35+ .setLoop(true );
36+
37+ // Or a sprite from the 1st image of the spritesheet
38+ graphicEntityModule. createSprite()
39+ .setImage(seaweedSprites[0 ])
40+ .setX(250 )
41+ .setY(250 );
2942```
3043
31- We can now use these images in Sprite entites as shown [ here] ( graphics-2-entities.md#creating-a-group-of-sprites ) .
44+ It should look like this :
45+ ![ Example] ( resources/spritesheet.gif )
46+
3247
3348## Using JSON sprites resources as assets
3449
You can’t perform that action at this time.
0 commit comments