Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

Lua API

Aditya edited this page Jul 30, 2022 · 5 revisions

you can extend goxel2 or procedurally generate art using Lua. currently Lua API is very basic with only 2 functions available but it will get mature by time.


API

  1. Create a box at x, y, z position:
GoxCreateBoxAt(x, y, z)

or Use the vector3 library provided by goxel2:

myPosition = Vector3.New(0, 0, 0)
GoxCreateBoxAt(myPosition:Get())

The function doesn't give any errors when the positions are out of bound.

  1. Remove a box at x, y, z position:
GoxRemoveBoxAt(x, y, z)
  1. Set color:
GoxSetColor(r, g, b)

The function changes the color which will be used when calling functions like GoxCreateBoxAt.

Note: the function clamps the given r, g, b between 0 to 255.

Clone this wiki locally