SpriteMultiSet

is the SpriteMultiSet even working?
there is a documentation page on it: http://developer.anscamobile.com/reference/index/spritenewspritemultiset

but the example is very short and doesn’t get to the point of creating a new sprite. I can’t seem to get it to work and googling for it showed only threads of people complaining about not being able to use it, there are no pages, no examples of someone using it correctly.

soo… does it work at all? if so, could you provide a working example?

thank you,
Bernardo @ BogeyBox [import]uid: 79152 topic_id: 14340 reply_id: 314340[/import]

Here is an example of it working.

  
local idleSheet = sprite.newSpriteSheetFromData( "Idle.png", require("Idle").getSpriteSheetData() )  
local walkSheet = sprite.newSpriteSheetFromData( "Walk.png", require("Walk").getSpriteSheetData() )  
  
local spriteSet = sprite.newSpriteMultiSet(   
{  
 { sheet = idleSheet, frames = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 } },  
 { sheet = walkSheet, frames = { 1,2,3,4,5,6,7,8,9,10,11,12,13 } },  
})  
  
sprite.add(spriteSet,"Idle",1,30,500,0)  
sprite.add(spriteSet,"Walk",31,43,450,0)  
  
local spriteInstance = sprite.newSprite(spriteSet)  
spriteInstance:setReferencePoint(display.BottomCenterReferencePoint)  
spriteInstance.x = 175;  
spriteInstance.y = 350;  
  
spriteInstance:prepare("Idle")  
spriteInstance:play()  

Thanks
ML [import]uid: 63352 topic_id: 14340 reply_id: 52957[/import]

Thanks matthewlebo :slight_smile:

Your example helped us fix our build (which also involved a typo lol)

thanks again
:slight_smile: [import]uid: 79152 topic_id: 14340 reply_id: 53444[/import]

I cant manage to get this example to work, it makes my simulator crash and die?

Using the exact code above and having 2 sheets by 512x512?

Joakim [import]uid: 81188 topic_id: 14340 reply_id: 55728[/import]

hej matthew!

shouldnt

sprite.add(spriteSet,“Walk”,31,43,450,0)

be

sprite.add(spriteSet,“Walk”,31, 13 ,450,0)

frameCount
Number: The total number of frames in the sequence. Must be a positive number.

regards, J [import]uid: 90610 topic_id: 14340 reply_id: 64613[/import]