Fade.lua

From Moondust Wiki
Revision as of 13:38, 14 August 2015 by Kevsoft (talk | contribs) (Created page with "[https://github.com/Wohlhabend-Networks/LunaDLL/blob/master/LuaScriptsLibExt/fade.lua Download Latest Version] fade.lua is a small library for creating colored fading effects...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Download Latest Version

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)