fix effects
This commit is contained in:
parent
e2203799dc
commit
7b34d9336a
|
@ -3,7 +3,7 @@ Effects = {}
|
||||||
function Effects.fadeIn(widget, time, elapsed)
|
function Effects.fadeIn(widget, time, elapsed)
|
||||||
if not elapsed then elapsed = 0 end
|
if not elapsed then elapsed = 0 end
|
||||||
if not time then time = 250 end
|
if not time then time = 250 end
|
||||||
widget:setOpacity(math.min((255*elapsed)/time, 255))
|
widget:setOpacity(math.min(elapsed/time, 1))
|
||||||
if elapsed < time then
|
if elapsed < time then
|
||||||
scheduleEvent(function()
|
scheduleEvent(function()
|
||||||
Effects.fadeIn(widget, time, elapsed + 30)
|
Effects.fadeIn(widget, time, elapsed + 30)
|
||||||
|
@ -14,7 +14,7 @@ end
|
||||||
function Effects.fadeOut(widget, time, elapsed)
|
function Effects.fadeOut(widget, time, elapsed)
|
||||||
if not elapsed then elapsed = 0 end
|
if not elapsed then elapsed = 0 end
|
||||||
if not time then time = 250 end
|
if not time then time = 250 end
|
||||||
widget:setOpacity((255*(time - elapsed))/time)
|
widget:setOpacity((time - elapsed)/time)
|
||||||
if elapsed < time then
|
if elapsed < time then
|
||||||
scheduleEvent(function()
|
scheduleEvent(function()
|
||||||
Effects.fadeOut(widget, time, elapsed + 30)
|
Effects.fadeOut(widget, time, elapsed + 30)
|
||||||
|
|
Loading…
Reference in New Issue