Is it possible to pause a Transition then Resume it? I know there is no API such as
transition.resume or transition.pause and I know is been ask in many different
forums to implement a pause all timer such as when you hit command arrow down
you suspend the simulator and if you hit it again you resume. So bottom line is
How will you Pause a Transition ? if we don`t have such API :(
it just an example of what can be done, i clearly cant understand it all
so if you figure it out, please let me know)
i'll share my five cents:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
local stop = true
instance1.x = 150
instance1.y = flor1.y - 37
function left()
print(stop)
if stop == true then
transition.to(instance1, {time = 500, x = 100, onComplete = right})
end
end
function right()
print(stop)
if stop == true then
transition.to(instance1, {time=500, x = 300, onComplete = left})
end
end
right()
local btn = display.newRect(0,0,50,50)
btn.x = 50
btn.y = 50
local function touch(event)
if event.phase == "ended" and stop == true then
stop = false
elseif event.phase == "ended" and stop == false then
stop = true
right()
end
end
btn:addEventListener("touch", touch) |
@ darkconsoles or Luffy (cool icon)
I tried testing your code and I manage to fix some errors on it but
I think we need something more efficient just like physics.pause()
and we don`t have one. But I came across something call
Transition Manager looks good I`m about to test it out and try
to implement it on my code and see if it does what I want it to do.
I`ll let you know results and if you want check it out this is the
linke to Transition Manager and they have a demo video.
Link: http://karnakgames.com/wp/2011/03/transition-manager-for-corona-sdk-pause-resume-and-manage-all-transitions-in-a-scene/