I was refactoring part of my code to use MultiSet sprites and had figured out this problem, when using prepare to use a named sequence which maps to a set that uses the second sprite. A sample code:
[lua] local ssheet1 = sprite.newSpriteSheet(“sheet1.png”, 52, 52);
local ssheet2 = sprite.newSpriteSheet(“sheet2.png”, 52, 52);
local sset = sprite.newSpriteMultiSet({
{sheet = ssheet1, frames = {1, 2, 3}},
{sheet = ssheet2, frames = {1, 2, 3}}});
sprite.add(sset, “red”, 1, 3, 1000, 1);
sprite.add(sset, “black”, 4, 3, 1000, 1);
local spt = sprite.newSprite(sset);
spt.x, spt.y = display.contentWidth * .5, display.contentHeight * .5;
spt:prepare(“black”);
spt:play();[/lua]
In spite of preparing the “black” set, the first frame shown is allways from “red”.
Sheets: http://dl.dropbox.com/u/28948129/sheet1.png and http://dl.dropbox.com/u/28948129/sheet2.png.
Please, could you confirm this?
Thank you. [import]uid: 50425 topic_id: 16649 reply_id: 316649[/import]