I originally built my game as 30 fps, but had cranked it up to 60 to get it running smoother. Now, I’ve got some sprites that are just a bit too fast. A lot of them are pretty large so I can’t double the images to make the loop last longer so would like to adjust the duration. That’s unfortunately not working out for me. No matter what I change it to, the sprites still play at the same speed.
I’m using this to bring the sprites into the level:
--ANIMATED BACKGROUND CHARACTERS
for key,data in pairs(leveldata.characters) do
spriteCharacter =sprite.newSpriteSheetFromData( data.src, require(data.page).getSpriteSheetData() )
local spriteSet = sprite.newSpriteSet(spriteCharacter,1,data.frames)
sprite.add(spriteSet,data.sprites,1,data.frames,1000,0)
spriteCharacter = sprite.newSprite(spriteSet)
spriteCharacter:play()
spriteCharacter.x = data.x
spriteCharacter.y = data.y
spriteCharacter.myName = data.myName
spriteCharacter.xScale, spriteCharacter.yScale = displayScale, displayScale
gameGroup:insert(spriteCharacter)
end
And this is what they are pulling in:
leveldata.characters =
{
sprite01 =
{
id = "sprite01",
src = "bray"..suffix..".png",
page = "bray"..suffix,
sprites = "bray"..suffix,
frames = 29,
x = 360,
y = 170,
myName = "bray"
},
sprite02 =
{
id = "sprite02",
src = "spinbean"..suffix..".png",
page = "spinbean"..suffix,
sprites = "spinbean"..suffix,
frames = 120,
x = 360+540,
y = 168,
myName = "spinbean"
},
}
Also, in there I’m using spriteCharacter.xScale, spriteCharacter.yScale = displayScale, displayScale to fit the @2x size versions for iPad, iPhone4 which is fine but they’re coming in double-size in the simulator for Android devices. Is there an alternative way I should do this to work on all platforms? [import]uid: 14032 topic_id: 8979 reply_id: 308979[/import]