Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Predefined objects

Felix edited this page Feb 11, 2017 · 3 revisions

By default, VoxelDesc exposes just five basic objects to the scripting engine:

Of these, you're going to use scene and camera 80% of the time. The others are mostly so you can say things like,

canvas.repaint();
app.window.setSize(1280, 1024);
console.window.visible = true;
Note for Java programmers
Yes, those are regular Java properties in the above example. console.getWindow().setVisible(true); works just as well (it's just a JFrame). But Javascript accepts a shorter, friendlier syntax.

In addition, VoxelDesc offers you 13 predefined colors: black, blue, cyan, dgray, gray, green, lgray, magenta, orange, pink, red, white and yellow. Considering you can modify each of them with .brighter() and .darker(), that gives you 39 predefined colors on the command line. But you can create any shade with scene.color(r, g, b), or the Palette dialog in the GUI.

Note for Java programmers
You'll notice this list corresponds to the constants in java.awt.Color; it's a selection as good as any other.
Clone this wiki locally