newImage( ) newImageRect( ) newSprite( )

Good evening, 

I understand that creating an imageRect allows the scaling of graphics associated with it to either scale to varying devices on demand, or to simply control the size of a graphic; Health bar etc.

My question concerns display.newSprite( ).

Are sprites “Dynamic” like imageRects, or do I need to create an imageRect, and then turn that imageRect into a sprite?

Or perhaps, as I contemplate this question, is the answer coming to me?

scaleX and scaleY

Are these properties a part of the sprite library, and do they achieve the same effects as the width and height of an imageRect?

Thank you for any assistance.

Chris

Hi Chris,

Sprites are already “dynamic”, assuming that you set up the image sheet which they access (pull frames from) in the proper manner. Meaning, you’ll need to set up the image sheet with the “sheetContentWidth” and “sheetContentHeight” parameters to enable content scaling, provide the proper multiple resolutions of sheet, etc. But once that’s done, you don’t need to do anything special to the sprite… it should grab the resources from the correct sheet depending on the image suffix setup you have in place.

See the example here about setting up the image sheet properly:

http://docs.coronalabs.com/api/library/graphics/newImageSheet.html

Take care,

Brent

Hi Chris,

Sprites are already “dynamic”, assuming that you set up the image sheet which they access (pull frames from) in the proper manner. Meaning, you’ll need to set up the image sheet with the “sheetContentWidth” and “sheetContentHeight” parameters to enable content scaling, provide the proper multiple resolutions of sheet, etc. But once that’s done, you don’t need to do anything special to the sprite… it should grab the resources from the correct sheet depending on the image suffix setup you have in place.

See the example here about setting up the image sheet properly:

http://docs.coronalabs.com/api/library/graphics/newImageSheet.html

Take care,

Brent