Thanks again Josh! I tested “spriteInstance.timeScale
” using Daily Build 528, and it works perfectly. 
Just to recap how cool and efficient this is, here’s a “before” and “after” from my code:
BEFORE [code]
– definition step
local playerSet = sprite.newSpriteSet( plSheet, 1, 10 )
sprite.add( playerSet, “plFloating”, 1, 10, 360, 0 )
sprite.add( playerSet, “plFlying”, 1, 10, 180, 0 )
– later: player starts flying
local frame = Player.currentFrame
Player:prepare(“plFlying”)
Player.currentFrame = frame --lines 7 & 9 needed to sync the animations
Player:play()
– and when player stops flying…
local frame = Player.currentFrame
Player:prepare(“plFloating”)
Player.currentFrame = frame
Player:play()
[/code]
AFTER
--player starts flying
Player.timeScale = 2.0
--player stops flying
Player.timeScale = 1.0
And so 8 lines of code became 2 lines! Also the animation is now perfectly synchronized because Corona doesn’t need to change sheets and look up frames, which technically worked but sometimes caused a visible skip when the switch occurred near the middle of a frame change.
Going forth with this API: I don’t think a value of “0” is necessary, because isn’t that exactly the same as the “:pause()” and “:play()” APIs? Maybe I’m not considering a scenario where having timeScale=0
might be necessary.
As for negative timescale, that could be very useful! I can imagine someday needing a method to simply reverse a one-directional animation, and currently that would require two different sprite sets, similar to my “before” scenario above.
Anyway, thanks again for your efforts here.
Brent Sorrentino
Ignis Design
[import]uid: 9747 topic_id: 10857 reply_id: 39699[/import]