Making the user interface data-driven using XML
A common practice in user interface programming is the division of design and program logic. In this recipe you will learn how to use one of the XML processing API that comes as a part of the standard libraries of the Python runtime used by Panda3D.
Note
Different versions of Panda3D might use different versions of Python. Don't assume these versions to be compatible as they might introduce changes to the standard library. You can check the version of the included Python runtime by issuing the command ppython --version on the console prompt.
Getting ready
Before proceeding, you will need to follow the recipe Setting up the game structure found in Chapter 1 to have the proper project structure set and ready.
How to do it...
Complete the following tasks to create a data-driven user interface:
Add a new source file to the project and name it
GuiBuilder.py.Add the following code to
GuiBuilder.py.GuiHandleris only a class stub. The following functions...