If I change the scale of the object in a transition. I have to manually reset it with a completion listener at the end of the transition. It would be cool to have a “resetOnComplete” parameter which takes all the variables back to original when complete. Such as scale, alpha etc. [import]uid: 8192 topic_id: 10822 reply_id: 310822[/import]
Title should have been complete transition not animation. [import]uid: 8192 topic_id: 10822 reply_id: 39331[/import]
Actually I think I have found a bug! If you set the inMode parameter to ALL it doesn’t scale back to the original size [import]uid: 8192 topic_id: 10822 reply_id: 39337[/import]
amigoni, could you please send in a small sample code to demonstrate this issue? We’ll fix this asap then. [import]uid: 10504 topic_id: 10822 reply_id: 39584[/import]
This is the bad code. With the ALL option. You’ll see that at the second transition the scale doesn’t work.
bonusText:applyInOutTransition(
{
hideCharsBefore = true,
hideCharsAfter = true,
startNow = false,
loop = false,
autoRemoveText = false,
restartOnChange = true,
-- IN TRANSITION
inDelay = 0,
inCharDelay = 1,
inMode = "ALL",
CompleteListener = CompleteListener,
--InSound = Snd\_Beep,
AnimateFrom = { xScale = 4.0, yScale = 4.0, y = -screenH/2, time = 300, transition = easing.outQuad },
-- OUT TRANSITION
outDelay = 1500,
outCharDelay = 1,
outMode = "ALL",
AnimateTo = { xScale = 4.0, yScale = 4.0, y = screenH/2, time = 200, transition = easing.inQuad, },
})
This is the good code. All I changed was the All to LEFT_RIGHT. The delay is set to 0 to emulate the all effect. It’s a good workaround.
bonusText:applyInOutTransition(
{
hideCharsBefore = true,
hideCharsAfter = true,
startNow = false,
loop = false,
autoRemoveText = false,
restartOnChange = true,
-- IN TRANSITION
inDelay = 0,
inCharDelay = 1,
inMode = "LEFT\_RIGHT",
CompleteListener = CompleteListener,
--InSound = Snd\_Beep,
AnimateFrom = { xScale = 4.0, yScale = 4.0, y = -screenH/2, time = 300, transition = easing.outQuad },
-- OUT TRANSITION
outDelay = 1500,
outCharDelay = 1,
outMode = "LEFT\_RIGHT",
AnimateTo = { xScale = 4.0, yScale = 4.0, y = screenH/2, time = 200, transition = easing.inQuad, },
})
[import]uid: 8192 topic_id: 10822 reply_id: 39592[/import]
Amigoni, just use the “restoreOnComplete” transition property and set it to true in your transition definition.
When set to true, the text object will be reset once the transition effect has ended.
This transition property wasn’t documented in the manual, so we probably just forget to note it there, sorry.
Example:
[lua]bonusText:applyInOutTransition(
{
hideCharsBefore = true,
hideCharsAfter = true,
startNow = false,
loop = false,
autoRemoveText = false,
restartOnChange = true,
– IN TRANSITION
inDelay = 0,
inCharDelay = 1,
inMode = “ALL”,
AnimateFrom = { xScale = 4.0, yScale = 4.0, y = -screenH/2, time = 300, transition = easing.outQuad },
– OUT TRANSITION
restoreOnComplete = true, – SEE HERE
outDelay = 1500,
outCharDelay = 1,
outMode = “ALL”,
AnimateTo = { xScale = 4.0, yScale = 4.0, y = screenH/2, time = 200, transition = easing.inQuad, },
})[/lua]
[import]uid: 10504 topic_id: 10822 reply_id: 39733[/import]
Great. Thanks [import]uid: 8192 topic_id: 10822 reply_id: 39738[/import]