newMultiSet problem

1
2
3
4
5
6
7
8
9
loqsprite = require ( 'loq_sprite' )
 
spriteFactory = loqsprite.newFactory()
    spriteFactory:newMultiSet(
        {'sprite_1', 'sprite_2'},
        {name='sprites', frameCount=67, frameRate=30, loopParam=0})
spriteA = spriteFactory:newSpriteGroup()
spriteA.x = 100
spriteA.y = 100

Hi, iPlayalot, I use Spriteloq, but I don't use it the way you do. When I have a multiple of spritesheets added to spriteFactory, mine looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- exported play1.swf, play2.swf and play3.swf
-- named each to sheet_play1, sheet_play2, sheet_play3
-- Spriteloq generated:
--        sheet_play1.png and sheet_play1.lua
--        sheet_play2.png and sheet_play2.lua
--        sheet_play3.png and sheet_play3.lua
-- and I use them in my code like this:
spriteFactory = loqsprite.newFactory("sheet_play1", "sheet_play2", "sheet_play3");
 
-- when I want to show/play each of these animation
spriteA = spriteFactory:newSpriteGroup("play1");
spriteA.x = 100
spriteA.y = 100;
spriteA:play();
 
spriteB = spriteFactory:newSpriteGroup("play2");
spriteB.x = 200
spriteB.y = 200;
spriteB:play();
 
spriteC = spriteFactory:newSpriteGroup("play3");
spriteC.x = 300
spriteC.y = 300;
spriteC:play();

thanks. I try but I cannot join them
I want to join two sprites because it is too big. (2048)
Also I want to control playing forward and reverse for the complete animation.

Hi iPlayalot,

It's been a while since I've checked the newMultiSet API. I'm not surprised it's not working properly. It wasn't designed for work with include reverse since the sprites are separate.

Can you send sample swfs and a code sample to support at loqheart? I'll see what I can do.

After giving it some more thought, I think you can totally avoid using newMultiSet. Just attach an event listener to listen for the sprite 'end' event and then play the next sprite in your sequence. That way you can play the reverse versions as well by chaining the reverse versions in reverse.

Hope that makes sense.

Hi don,

Yes, I avoid using newMultiset.

I will use an event listener.

Thanks

Ok great. I hope that works out for you. I think I'm going to remove newMultiSet from the Spriteloq API. It's overly complicated, and maybe hmm maybe it'd be better to create a convenience function that will play a series of sprites in sequence.

views:1633 update:2012/1/1 13:29:50
corona forums © 2003-2011