How would I go about drawing a sprite from a sprite atlas?
Create 2D games in JavaScript, made easier · By
Pixelbox can pack images in a spritesheet for you. If you have sprites as separate images, put theses in a same folder inside 'assets'. Then, in the assets editor, right click on this folder and click "set as atlas":
If you want to reuse an atlas created by another software, you can have a look at the Sprite class in the engine. You'll have to convert your atlas data into Sprite instances. Then, you should be able to draw these sprites like normal images:
draw(mySprite, x, y)
My understanding is that an image would be generated that includes all the images from the parent folder marked as an atlas. When building an archive or running the game however, I don't see any such image being generated. Could you explain how this should work please? I assume this is just an optinization allowing fewer requests for images in the browser since you can access those images without them being in an atlas.