render on z-index
Problem it solves
You want to draw something custom on the screen every frame—like a health bar or a minimap—layered correctly with sprites and backgrounds.
What this block does
Registers a function that draws onto the screen image every frame, at the given z-index (layering order).
The block
Block ID: spriteutilextcreaterenderable
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| index | number | — | The z-index to draw at |
Example
spriteutils.createRenderable(scene.HUD_Z, function (screen) {
screen.print("HP: 100", 4, 4)
})Add the extension
Add github:jwunderl/arcade-sprite-util to your project, or open: Import arcade-sprite-util.