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

App object

Felix edited this page Mar 15, 2016 · 2 revisions

The app object implements VoxelDesc's user interface, and generally ties everything together.

Properties

.console
.scene
.camera
.canvas
These are the same objects you can also access directly as a convenience; they actually "live" inside the app object.
.window
.helpdlg
JFrame objects (see below) representing the main application window and the help window respectively.
.messages
.history
The last 100 messages displayed and commands entered, respectively. Useful because the main window only shows the last 16 messages.
.saveFile
The current working file, if the scene has been saved at least once, or else the value null.
.cmdLine
The command line object, as detailed below.

Methods

.open(filename)
.loadScript(filename)
.export(filename)

Window objects

For Java programmers, these are ordinary JFrame objects. Use with confidence.

Everyone else should probably stick to the basics:

.title
A string (set like this: window.title = "..."). Does what you expect
.visible
A boolean (true/false). Does what you expect.
.size
Just what it says on the tin. Easier to set it like this: window.setSize(width, height).

The command line

For obvious reasons, you can't very well manipulate the command line by typing commands in it. You'll probably want to use the console instead.

For Java programmers, the command line is a JTextField object. Have fun.

For everyone else, the most important property of the command line is .text. Call app.handleCommandLine() to try and run whatever is displayed on the command line at any given time.

Clone this wiki locally