sbgui can draw 2D elements such as text, boxes and a variety of interactive widgets. The CEGUI library has been incorporated into sbgui (http://cegui.org.uk/) and any functionality from that 2D GUI system can be combined with SmartBody via Python.
2D Interface Example Using CEGUI
Creating a text box:
winManager = WindowManager.getSingleton() myText = winManager.createWindow('OgreTray/StaticText', 'myTextBox') myText.setText("This is some text") System.getSingleton().getDefaultGUIContext().getRootWindow().addChild(myText)
then the text can be changed:
myText.setText("The text has changed!")
There are some samples in the data/examples/CEGUI folder, and a file called GUIUtil.py which simplifies the code needed for GUI creation. However, you are only limited by the functionality in the CEGUI library.
sbgui can also draw simple 3D elements, such as points as lines using the following interface:
Function | Description | Usage |
---|---|---|
GUIInterface.addPoint() | Draws a point in 3D.
| addPoint(name, location, color, size) where name is a string, location is an SrVec, color is an SrVec, and size is an integer |
GUIInterface.removePoint() | Removes a point in 3D with a given name. | removePoint(name) |
GUIInterface.removeAllPoints() | Removes all points. | removeAllPoints() |
GUIInterface.addLine() | Draws a line in 3D.
| addLine(name, points, color, width) where name is a string, points is a vector of SrVecs, color is an SrVec, and width is a float |
GUIInterface.removeLine() | Removes a line in 3D with a given name. | removeLine(name) |
GUIInterface.removeAllLines() | Removes all lines. | removeAllLines() |