Show
The most important thing to know when creating a graphic is how to show the graphic on the screen. VBOX Touch uses a display list that is then passed to the gui.show() function.
Display lists are a set of graphic command instructions in a list. These can contain sublists that use the gui.SUBLIST command to make the gui.show() aware that this is a sublist and not a mistake.
In small programs, as you will see below in Drawing a circle, the display list is passed directly into gui.show(). However, in bigger programs, it is advised that you store this in a variable. For example:
# The following 2 bits of code will display the same thing.
gui.show([
[gui.DL_POINT_SIZE(20)],
[gui.DL_COLOR_RGB(0,255,0)],
[gui.PRIM_POINTS,
[gui.DL_VERTEX2F(400, 240)]
]
])
# A common convention is to name this list gui_l or gui_dl
gui_l = [[gui.DL_POINT_SIZE(20)], [gui.DL_COLOR_RGB(0,255,0)], [gui.PRIM_POINTS,[gui.DL_VERTEX2F(400, 240)]]]
gui.show(gui_l)