Dynamic Retina SpriteSheets? Here's how!

Yep, that’s what I tried at first but I couln’t. Ansca says I cannot post to the code exchange even though I have paid the Indie license and everything. I also wrote them about this but no answer. [import]uid: 46260 topic_id: 4284 reply_id: 37163[/import]

Hi. Please help me.

I have problems with sprites in hi resolutions iphone 4.
l have the same issue as several hours ago…the object is huge (dimensions of @2x sprisheet), but the content is scaled down. Therefore, giving the illusion that the object is floating.
The problem begin when i use physics.

i USE: vaca1.xScale=.5;
vaca1.yScale=.5;

ir order to have hi res spritesheets, but when i use physics the objetc have a padding, espace, look like the object is floating.

PLease help me , i am new programer [import]uid: 11125 topic_id: 4284 reply_id: 41147[/import]

I was having this same “floating” issue today when i apply physics to my @2 sprites.

I got around the issue by applying a custom shape to the physics objects, e.g. below. This may not be a great way to do it, but if anyone is in the same situation with me, then this could be helpful.

[code]
local device = system.getInfo( “model” )
local enemyNormal1

if device == “iPad” then
enemyNormal1 = sprite.newSpriteSheet( “lumber4@2.png”, 32, 46 )
else
enemyNormal1 = sprite.newSpriteSheet( “lumber4.png”, 16, 24 )
end

local spriteSet = sprite.newSpriteSet(enemyNormal1,1,8)
sprite.add(spriteSet,“man1”,1,4,700,0)
sprite.add(spriteSet,“man2”,5,4,700,0)

local enemy = sprite.newSprite( spriteSet )
enemy.x = xLeft; enemy.y = randomY; --Random x/y was set elsewhere.
–Play Sprite…
enemy:prepare(“man1”)
enemy:play()

if device == “iPad” then
enemy.xScale = 0.5; enemy.yScale = 0.5;
local squareShape = { -8,-10, 8,-10, 8,10, -8,10 }
physics.addBody(enemy, { isSensor = true, shape = squareShape} );
else
physics.addBody(enemy, { isSensor = true } )
end
[/code] [import]uid: 69826 topic_id: 4284 reply_id: 74667[/import]

Just updating an old thread since it keeps popping up in my searches for “retina spritesheets”.

I noticed a new property in one of the daily builds: display.imageSuffix …which can be used in the code of @AdamBucketz (waay above this thread) for manually adding a suffix to a spritesheet.

I hope this is still applicable now though [import]uid: 144908 topic_id: 4284 reply_id: 113136[/import]