The following code creates a sprite and scales it to 64 x 64.
local spriteSheet = graphics.newImageSheet("images/spriteSheet.png", {width = 32, height = 32, numFrames = 96})
local sequenceData =
{
{name = "walkUp", sheet = spriteSheet, frames = {85, 86}, time = 500, loopCount = 0},
{name = "walkDown", sheet = spriteSheet, frames = {49, 50}, time = 500, loopCount = 0},
{name = "walkLeft", sheet = spriteSheet, frames = {61, 62}, time = 500, loopCount = 0},
{name = "walkRight", sheet = spriteSheet, frames = {73, 74}, time = 500, loopCount = 0}
}
local sprite = display.newSprite(spriteSheet, sequenceData)
sprite.x = 500
sprite.y = 500
sprite.width = 64
sprite.height = 64
The moment I play an animation, the sprite scales back to 32 x 32.
sprite:setSequence("walkDown")
sprite:play()
What am I doing wrong here? I need the sprite to stay the size I set it to. I can’t just change the imageSheet; the sprite must be able to scale to many different sizes on the fly. [import]uid: 99903 topic_id: 33591 reply_id: 333591[/import]