I am new to Corona Development, and have run into a bit of an issue. My artist created a spritesheet in TexturePacker, and I have included it in my game.
if timePerTurn \> 0 then
local timerSheetData = require "timer"
local timerSpriteSheet = sprite.newSpriteSheetFromData( 'skins/' .. skin .. '/timer.png', timerSheetData.getSpriteSheetData()
local timerSpriteSet = sprite.newSpriteSet(timerSpriteSheet, 1, 37)
sprite.add( timerSpriteSet, "timer", 1, 37, (timePerTurn / 37) \* 1000, 1)
end
The code above doesn’t throw any errors, but the following code does.
if timePerTurn \> 0 then
local playerOneTimer = sprite.newSprite( timerSpriteSet )
local playerTwoTimer = sprite.newSprite( timerSpriteSet )
end
I get the following error when I run Corona.
Runtime error multiplayerScene.lua:71: bad argument #1 to 'newSprite' (sprite.ISpriteSet expected, got nil)
Am I doing something wrong? I have verified that both the .lua file generated by TexturePacker and the .png spritesheet are in the folder.
Thanks in advance. [import]uid: 18601 topic_id: 12981 reply_id: 312981[/import]