MakeCode Games!

A fan-made community library of MakeCode Arcade games. Visit MakeCode Arcade to make a game!

← Back to extensions

Sprite Utils

A grab-bag of sprite math and rendering helpers for MakeCode Arcade: distances, angles, movement, timers, and simple drawing.

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

render on z-index $index to $screen block

Parameters

NameTypeDefaultMeaning
indexnumberThe 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.