You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
straker
changed the title
Allow Sprite to draw single image from spritesheet / tilemap.
Allow Sprite to draw single image from spritesheet / tilemap
Sep 14, 2023
Possibly. The sprite will at least need access to the spritesheet in order to draw from it. But it will also need to know the x/y (or row/col) of the start of the sprite image, and the width/height (or numRow/numCol) of the image. A spritemap can have sprites of different sizes and they don't necessarily have to align to any grid.
Someone recently asked what the best way was to use a Sprite to display a spritesheet that only contained individual sprites. I did something similar for my 2021 entry and used a tileatlas to map all the image locations and then a custom draw function to draw the image from the spritesheet.
It would be nice to implement the ability for a
Sprite
to be able to use a tilesheet like this instead of having to do it manually every time.The text was updated successfully, but these errors were encountered: