GraphX.lua

From Moondust Wiki
Jump to navigation Jump to search
This is the archived page of the old LunaLua documentation
The rest of LunaLua related articles in this wiki contain a lot of outdated documentation preserved for historical purposes and may be used with legacy versions of the LunaLua.
Please visit the SMBX2 Documentation Page to access the latest documentation for the LunaLua scripting system of the SMBX2 Project.
Adding LunaLua contents into this Wiki is not advised.
DEPRECATED: DEPRECATED IN LUNALUA V0.6!!! Use sprite class instead!!!


graphX is a helper library for drawing primitives. It was derived from colliders.lua and is being developed as part of the cinematX suite.

Installation

graphX comes packaged with cinematX v0.8+. You can download the latest development version from the cinematX repo. Add graphX.lua and the graphX folder to your LuaScriptsLib folder.

How to Use

Code Documentation

graphX
Type Function/Field Return values/Value type Description
function boxLevel (double x, double y, double width, double height, Color color, LuaImageResource texture) nil Draws a colored box at the given coordinates in the level.

(Texture only in v0.3+)
function boxScreen (double x, double y, double width, double height, Color color, LuaImageResource texture) nil Draws a colored box at the given coordinates on the screen.

(Texture only in v0.3+)
function circleLevel (double x, double y, double radius, Color color) nil Draws a colored circle at the given coordinates in the level.
function circleScreen (double x, double y, double radius, Color color) nil Draws a colored circle at the given coordinates on the screen.