Fade.lua
Jump to navigation
Jump to search
fade.lua is a small library for creating colored fading effects and colored overlays.
Installation
Copy the fade.lua file in the LuaScriptsLib folder.
How to use
To enable the fade library for a specific level, add this line to lunadll.lua:
local fade = loadAPI("fade");
This will load the Fade API.
Example
Simple Fade Effect
local fade = loadAPI("fade");
local myCustomFade = fade()
myCustomFade:setStart(255, 255, 255, 255)
myCustomFade:setEnd(255, 255, 255, 0)
myCustomFade:setTransitionTime(65*4)
function onLoad()
myCustomFade:start()
end
This will create a fade effect which starts from full white to full opacity. If you want to, you can also use hex-values instead:
myCustomFade:setStart(0xFFFFFFFF)
myCustomFade:setEnd(0xFFFFFF00)
Simple Color Overlay
local fade = loadAPI("fade");
local myCustomOverlay = fade()
myCustomOverlay:setStart(0, 0, 255, 100)
myCustomOverlay:setEnd(0, 0, 255, 100)
function onLoad()
myCustomOverlay:start()
end
This will create a blue overlay over the level.
Documentation
(in progress)