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

Here is an example of it working.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 matthewlebo :)

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

thanks again
:)

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

views:645 update:2011/9/25 12:40:18
corona forums © 2003-2011