I’ve heard in the past that it is best to keep images a power of 2 and to use sprite sheets for everything.
Following that, I’d like to put a bunch of 128x128 images into a 512x512 sheet. What would be the best way to display each cell individually? Do I need to create 16 sprite sets and 16 sprite instances?
Ideally I’d like to do something like this:
local sheet = sprite.newSpriteSheet("image.png", 128, 128)
local bike = sheet.newImage(1,x,y)
local car = sheet.newImage(2,x,y)
local pig = sheet.newImage(3,x,y)
-- etc. etc.
Where x and y are some coordinates on screen and 1,2,3 are frames in the sprite sheet.
[import]uid: 8434 topic_id: 1790 reply_id: 301790[/import]