I’m trying to make a transition using the alpha channel, but I found a problem.
If I try to go from 1-0, everything works perfect.
Code:
Disparo = display.newRect (300,300,50,50)
Disparo :setFillColor(1,0,0)
Telon = display.newRect (500,500,100,100)
Telon :setFillColor(0,1,0,1)
function Cat1 (event)
function Arranque ()
Telon.x= -600
Telon.y= -600
end
transition.to( Telon, { time=1500, delay=0, alpha=0, onComplete=Arranque} )
end
Disparo:addEventListener(“tap”, Cat1)
But, if I go from 0 to 1, does not work.
I wanna know what I’m doing wrong.
Code:
Disparo = display.newRect (300,300,50,50)
Disparo :setFillColor(1,0,0)
Telon = display.newRect (500,500,100,100)
Telon :setFillColor(0,1,0,0)
function Cat1 (event)
function Arranque ()
Telon.x= -600
Telon.y= -600
end
transition.to( Telon, { time=1500, delay=0, alpha=1, onComplete=Arranque} )
end
Disparo:addEventListener(“tap”, Cat1)