HELP - How To - Dynamic size images with ImateSheet, newImageGroup - newImageRect

I am working on a project where I want to start using SpriteSheets instead of a bunch of local images.

I know that the display.newImageRect() will use the normal image & @2 image automatically.

But how do we do the same when using Sprite Sheets ( ImageSheet - newSprite )

display.ImageSheet()
display.newImageGroup()
display.newSprite()
display.newImageRect()

Any help would be very helpful.

Larry

DoubleSlashDesign.com [import]uid: 11860 topic_id: 29937 reply_id: 329937[/import]

This might help -

http://www.coronalabs.com/blog/2012/03/06/image-sheets-image-groups-and-sprites/

Dave [import]uid: 117617 topic_id: 29937 reply_id: 120066[/import]

So the article says this

**-- The params below are optional; used for dynamic resolution support

sheetContentWidth = 70, – width of original 1x size of entire sheet
sheetContentHeight = 82 – height of original 1x size of entire sheet

As you can see from the example, the simple case really is simple! The only required parameters in the options table is width, height, and numFrames. The remaining two optional parameters is if you are using dynamic resolution images (such as an @2x version of your image sheet for retina graphics), and correspond to the width and height of the original 1x source image.**

Now my question this: do we need to have a separate SpriteSheet named Sheet@2 with the upscale images in it?

and if so will the newImageSheet - open it automatically and map it by itself based on knowing the first file is @1.

Or am i missing something about the
sheetContentWidth
sheetContentHeight

thanks
Larry [import]uid: 11860 topic_id: 29937 reply_id: 120070[/import]

I’m doing the same thing.

As far as I’m aware, you have a @2x in your config.lua

 imageSuffix =  
 {  
 ["@2x"] = 1.8,  
 },  

You will need an image which is double the scale for the @2x.
And I believe it will automatically substitute the @2x when the requirement is met.

(PS: My requirement is 1.8 because It will allow certain tablet devices which aren’t fully x2 the size to use the upscaled version. This is a work in progress for me.) [import]uid: 91798 topic_id: 29937 reply_id: 120077[/import]

This might help -

http://www.coronalabs.com/blog/2012/03/06/image-sheets-image-groups-and-sprites/

Dave [import]uid: 117617 topic_id: 29937 reply_id: 120066[/import]

So the article says this

**-- The params below are optional; used for dynamic resolution support

sheetContentWidth = 70, – width of original 1x size of entire sheet
sheetContentHeight = 82 – height of original 1x size of entire sheet

As you can see from the example, the simple case really is simple! The only required parameters in the options table is width, height, and numFrames. The remaining two optional parameters is if you are using dynamic resolution images (such as an @2x version of your image sheet for retina graphics), and correspond to the width and height of the original 1x source image.**

Now my question this: do we need to have a separate SpriteSheet named Sheet@2 with the upscale images in it?

and if so will the newImageSheet - open it automatically and map it by itself based on knowing the first file is @1.

Or am i missing something about the
sheetContentWidth
sheetContentHeight

thanks
Larry [import]uid: 11860 topic_id: 29937 reply_id: 120070[/import]

I’m doing the same thing.

As far as I’m aware, you have a @2x in your config.lua

 imageSuffix =  
 {  
 ["@2x"] = 1.8,  
 },  

You will need an image which is double the scale for the @2x.
And I believe it will automatically substitute the @2x when the requirement is met.

(PS: My requirement is 1.8 because It will allow certain tablet devices which aren’t fully x2 the size to use the upscaled version. This is a work in progress for me.) [import]uid: 91798 topic_id: 29937 reply_id: 120077[/import]