I am trying to get the following code to work, but so far it does not work. I got the code off a sprite tutorial from anscamobile. All I did was copy and paste. I have not edited anything except the file name to load my spritesheet that is in the main project directory.
require “sprite”
local sheet1 = sprite.newSpriteSheet(“Flames.png”, 100, 100)
local spriteSet1 = sprite.newSpriteSet(sheet1, 1, 15)
local instance1 = sprite.newSprite(spriteSet1)
instance1.x = display.contentWidth/2
instance1.y? = display.contentHeight/2
instance1:play()
So all in all it looks like it should work, but doesn’t. Can anyone help me get it working? Im still in learning mode here so every bit of help is appreciated.
Also, if there is a better way of loading and playing a spritesheet, please post! I have tried a few things but my options are limited as, once again, im still learning about Lua…
Thank you. [import]uid: 157993 topic_id: 30190 reply_id: 330190[/import]
[import]uid: 52491 topic_id: 30190 reply_id: 120945[/import]
I find it more comfortable. [import]uid: 160496 topic_id: 30190 reply_id: 120948[/import]