Hi,
I got a PNG image loaded into the sprite object via URL.
Before loading the next one, I need to clear the sprite object, so the last PNG does not shine through the next one.
How can I do this?
Thanks :)
Develop games in your browser. Powerful, performant & highly capable.
OK, got it.
canvas.width = canvas.width;
does the job in js. Just need to add an event everytime the sprite should be cleared:
set canvas size to sprite.width x sprite.height
in case the sprite size is the same as the layer.