What it does
sprite.setSnap sets Snap on a sprite object. It takes id and bool.
Signature
sprite.setSnap(id, bool)Arguments
idbool
Example · generated
function start() { const id = sprite.create('/sprites/hero.png', 100, 120); sprite.setSnap(id, true);}sprite.create is there to give the call something to act on; sprite.setSnap is the line that matters. The code sits in start(), which the engine calls once, when the entity spawns.