Manually set the frame of a sprite sheet

Is it possible to manually set the current frame of a sprite set instance?

In the docs there is this line - “currentFrame = frame # of animation. read/write.” however setting it doesn’t seem to make any difference. [import]uid: 5833 topic_id: 1635 reply_id: 301635[/import]

This should be fixed in Alpha 3 (released today). But let us know if you’re still having problems! [import]uid: 3007 topic_id: 1635 reply_id: 4860[/import]

That is working now however I am still having a problem with my sprite sheet.

The sprite sheet is here - http://dl.dropbox.com/u/571145/sheet-tiles-special.png - which contains 27 50*50 frames (including one blank one). When I start creating sprite sets with this it is all fine until I try to create one from frames higher than 18 where I get this error - “sequence frames must be inside the sheet”

My code is as follows -

[code]

local specialTileSpriteSheet = sprite.newSpriteSheet(“sheet-tiles-special.png”, 50, 50)

local spriteSetBomb = sprite.newSpriteSet(specialTileSpriteSheet, 1, 8)
local spriteSetLock = sprite.newSpriteSet(specialTileSpriteSheet, 10, 18)
local spriteSetMultiplier2 = sprite.newSpriteSet(specialTileSpriteSheet, 23, 24)
local spriteSetMultiplier3 = sprite.newSpriteSet(specialTileSpriteSheet, 21, 22)
local spriteSetMultiplier5 = sprite.newSpriteSet(specialTileSpriteSheet, 19, 20)[/code]

It first dies when it reaches the spriteSetMultiplier2 creation. [import]uid: 5833 topic_id: 1635 reply_id: 5100[/import]

The 3rd parameter to newSpriteSet is number of frames, not last frame. So

local spriteSetLock = sprite.newSpriteSet(specialTileSpriteSheet, 10, 18)

Should be

local spriteSetLock = sprite.newSpriteSet(specialTileSpriteSheet, 10, 9)

and

local spriteSetMultiplier2 = sprite.newSpriteSet(specialTileSpriteSheet, 23, 24)

should be

local spriteSetMultiplier2 = sprite.newSpriteSet(specialTileSpriteSheet, 23, 2)

etc
[import]uid: 54 topic_id: 1635 reply_id: 5104[/import]

Ah that’s brilliant, foolish me. Thank you for clearing that up for me. [import]uid: 5833 topic_id: 1635 reply_id: 5119[/import]

Actually you were right first time. The sprite library expects startframe, endframe, despite what the docs say. But unfortunately the error checking code thinks it should be framecount as the second parameter. So if you put 2 as the second parameter, as in your sample, it won’t work unless startframe <= 2. [import]uid: 3953 topic_id: 1635 reply_id: 5201[/import]