Skip to content

Commit 4332715

Browse files
committed
feat(doc): spritesheetSplitter example
1 parent 304d149 commit 4332715

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

playground/graphics/graphics-4-spritesheets.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff 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

35.1 KB
Loading

0 commit comments

Comments
 (0)