Skip to content

Commit d82b6c9

Browse files
Create addScenePushHandler
1 parent c55fab1 commit d82b6c9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## addScenePushHandler
2+
Registers a handler that runs whenever a scene is pushed onto the scene stack.
3+
4+
## Example
5+
Add a new sprite when the handler is registered.
6+
``` ts
7+
game.addScenePushHandler(() => {
8+
let mySprite = sprites.create(img`509509505950950`, SpriteKind.Player);
9+
})
10+
11+
game.pushScene(); // push the scene to register it
12+
```

0 commit comments

Comments
 (0)