newImage on a sprite sheet

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]

Not knowing the internals I can’t say which way is more efficient, but I do know this works fine:

local sheet = sprite.newSpriteSheet("512x512.png", 128, 128)  
local spriteSet = sprite.newSpriteSet(sheet, 1, 16) -- total frames available to this set  
sprite.add(spriteSet, "whatever", 1, 16, 1, 0)  

Then for each DisplayObject you need:

local mySprite = sprite.newSprite(spriteSet)  
mySprite.currentFrame = n -- where n is an index into your sprite set  

[import]uid: 3953 topic_id: 1790 reply_id: 5313[/import]