example:
local sheet2 = sprite.newSpriteSheet( "greenman.png", 128, 128 )
local spriteSet2 = sprite.newSpriteSet(sheet2, 1, 15)
sprite.add( spriteSet2, "man", 1, 15, 200, 0 ) -- play 15 frames every 200 ms
local instance2 = sprite.newSprite( spriteSet2 )
instance2.x = 3 \* display.contentWidth / 4 + 30
instance2.y = baseline - 55
instance2:prepare("man")
instance2:play()
why do we have to write instance2.prepare(“man”)
is it possible to have more then one spriteset in same instance?
so I we need to specify
instance2:prepare(“man”)
code …
instance2:prepare(“man-run”)
code…
instance2:prepare(“man-stop”)
code…
If I missunderstood this then why have to specify name. If only one spriteset can be stored in single sprite instance, then I’d like to call my sprite instance
local man = sprite.newSprite( spriteSet2 )
man.prepare(“man”)
man.prepare()
Documentation on this is not perfect, so can someone who understands this better explain why when we run prepare name has to be specified…
[import]uid: 13099 topic_id: 7521 reply_id: 307521[/import]
[import]uid: 13099 topic_id: 7521 reply_id: 26672[/import]