I’m currently porting a flash game from AS3 to Lua using the Corona Game Edition.
I decided I’d use sprite sheets for fast performance.
There’s a major problem with it - it doesn’t import my sheet properly.
My sheet’s height is 104px.
My sheet’s width is 4410px.
My sheet has a total of 14 frames.
I’m able to animate through it, however I’m not able to specify any frame height above 12px (therefore I can only see the tops of each frame) without getting the error message:
'frameHeight' must be less than sheet height
Here is my sprite sheet image:
http://www.mediafire.com/?ntyqktztgt1
Here is my sprite sheet code:
local dgGame = display.newGroup()
dgGame.x = 0
dgGame.y = 0
local dgScreen\_MainMenu = display.newGroup()
dgGame:insert( dgScreen\_MainMenu )
dgScreen\_MainMenu.x = 0
dgScreen\_MainMenu.y = 0
local sheet1 = sprite.newSpriteSheet( "title\_logo.png", math.floor(4410/14), 104 )
local spriteSet1 = sprite.newSpriteSet(sheet1, 1, 10)
local instance1 = sprite.newSprite( spriteSet1 )
dgScreen\_MainMenu:insert( instance1 )
instance1.x = math.floor(display.contentWidth / 2)
instance1.y = math.floor(display.contentHeight / 2)
instance1:play()
Any suggestions? Am I doing something wrong, or is this seriously broken?
[import]uid: 7366 topic_id: 1353 reply_id: 301353[/import]