reorganize modules

This commit is contained in:
Eduardo Bart
2011-11-02 01:02:56 -02:00
parent 2304ff3529
commit 5ab0e6f2ac
59 changed files with 147 additions and 208 deletions

26
modules/core/gfx.lua Normal file
View File

@@ -0,0 +1,26 @@
GFX = { }
function GFX.fadeIn(widget, time, elapsed)
if not elapsed then elapsed = 0 end
if not time then time = 250 end
widget:setOpacity(math.min((255*elapsed)/time, 255))
if elapsed < time then
scheduleEvent(function()
GFX.fadeIn(widget, time, elapsed + 30)
end, 30)
end
end
function GFX.fadeOut(widget, time, elapsed)
if not elapsed then elapsed = 0 end
if not time then time = 250 end
widget:setOpacity((255*(time - elapsed))/time)
if elapsed < time then
scheduleEvent(function()
GFX.fadeOut(widget, time, elapsed + 30)
end, 30)
else
widget:destroy()
end
end