Time for a beta release! (I’m not sure how to package it. Let me know if I’m missing anything).
Status: it works well enough.
TODO:
Cleanup the code (formatting, etc.)
Bug: select some text in the multiline textbox, and scroll down. Sometimes, the selection background does not get updated properly. This has to do with quad caching, I’m working on it.
Usage
This code gets you something like the screenshots above:
...
# Init Cegui
CeguiSupport.init(base.win,
base.mouseWatcher.getParent(),
render2d)
# Create GUI
root = cegui.WindowManager.getSingleton().loadWindowLayout('FontDemo.layout')
sys = cegui.System.getSingleton()
sys.GUISheet = root
...render loop...
Installation
Note: this is for Linux/Mac, Ppremake only (see questions below).
You’ll need CEGUI itself and Python bindings for it. Compile and install the following:
CEGUI 0.6.2:
prdownloads.sourceforge.net/cray … z?download
CEGUIPython:
svn co http://svn.projectxenocide.com/xenocide/trunk/cegui/ScriptingModules/CEGUIPython CEGUIPython
I’ve had some trouble compiling CEGUIPython on a Mac, I hope it will be easier on Linux. I’m not sure if it is currently matching CEGUI 0.6.2. I had to fiddle with it a bit to get it to compile.
Patch for the Panda source tree:
pastebin.ubuntu.com/154468/
You’ll also need to copy the datafiles directory from CEGUI/Samples/datafiles into panda/src/cegui/datafiles. This contains textures, etc, which the patch doesn’t contain.
Compiling:
cd dtool
ppremake
make && make install
cd ../panda/src/cegui
ppremake
make && make install
genPyCode libpcegui
This exposes a single Python method, CeguiSupport.init, to initialize the renderer and the input injector. The rest is done in Python, using the CEGUIPython bindings.
It is also usable from pure C++, see cegui.cxx for an example.
Now, my questions.
- Cegui requires a method that returns the maximum texture size supported by the renderer. Where do I get this in Panda?
Packaging questions:
-
I only have support for ppremake right now. What else needs to be supported? makepanda? How does the Windows build work?
-
What are metalibs for? Do I need to add anything there?
-
How do we want to include CEGUI? Should we link to it statically?
I guess CEGUI and CEGUIPython will go in the thirdparty dir. I was told that ODE is linked to statically, and is one of the thirdparty packages. However, mine is compiled with the ODE that was installed separately. What is the proper way to do things like that?
What else am I missing?