librocket GUI support

I recently checked in some improvements to the libRocket code.
For one, I noticed that text was a bit fuzzy around the edges, so I checked in a fix to make that crisper (by disabling linear texture filtering, which I don’t think is supposed to be on). If people prefer linear filtering, let me know, and I’ll make it configurable using a Config.prc variable.

There was also no way for people to access Panda’s compiled-in default font; Panda now loads this by default into libRocket, so you can use the font face “Perspective Sans” out of the box without having to load a custom .otf or .ttf file. It’s a fine general-purpose font, and this makes it easier for people to get started.

Does anyone can work on the use of static geometry ?

Could you explain what you mean?

In case anyone else was wondering, it seems element.RemoveEventListener() is also not exposed properly.

I’ve posted in the libRocket forums about it.

Unfortunately the forum is down (again), the forum is quite dead and the project is dead, too. Near to nothing happens :-/

which alternative you advice to use in this case?

I have no alternative, at the very moment :-/

I wonder If I will not migrate to cegui.
I was on cegui, but because not directly supported by panda3D I migrated to librocket.

And in Cegui there is animation…

The only problem is I need to write my own package to be able to generate exe files.

They have a nice feature set comparison for the open source GUI libraries on the ogre website.

From that perspective it looks like CEGUI is far and away the best option.

I’m not sure if I fully understand how to properly implement LibRocket into use. I’ve checked around its own tutorials and the code snippets I could find from here, but I’m still left a bit perplexed.

For example, if I do an event listener like this:

		myBut = doc.GetElementById("button")
		myBut.AddEventListener("click", self.myClicker)

	def myClicker(self):
		print "event: ", event
		print "event.current_element: ", event.current_element
		print "event.type: ", event.type
		print "event.parameters: ", event.parameters

Then it disappears whenever the document is reloaded, like when it internally changes menus. So what actually is the right way to get events from LibRocket’s RML to my P3D app? :blush:

If you’re modifying the dom and rewriting the element, then it’s perfectly normal. Fairly certain the same thing would happen with javascript in an HTML document. Even if they have the same IDs, the elements will be new, so you’d still have to link to them.

Just in case anybodies been wondering - it seems librocket has a few new maintainers, and it looks like some of the pull requests sitting in github will hopefully start to be merged : github.com/libRocket/libRocket/issues/130

Which is good news :slight_smile:

Anybody else having problem with libRocket in 1.9?

Getting these with my new Windows 8 system:

rocket.LoadFontFace("./data/Delicious-Roman.otf")
AttributeError: 'module' object has no attribute 'LoadFontFace'

And when I don’t load a font:

context = r.getContext()
TypeError: No to_python (by-value) converter found for C++ type: class Rocket::Core::Context *

My old code isn’t working, but the above can be replicated with the sample here:

My 1.9 i386 install is from 20 Jun.

Yes, currently there is an issue, it can be worked around by changing your import scheme as follows:

import _rocketcore as rocket
from panda3d.rocket import RocketRegion, RocketInputHandler

Great! Thanks for that :slight_smile:

Has anyone got librocket working with Panda3D 1.9?

I get the following error:

DirectStart: Starting the game.
Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)
Traceback (most recent call last):
  File "testAwesomeTools.py", line 2, in <module>
    import _rocketcore as rocket
ImportError: /usr/lib/panda3d/libboost_python.so.1.48.0: undefined symbol: PyUnicodeUCS2_FromEncodedObject

This is from the Ubuntu Trusty SDK debs. I tried three of them, including the latest, and I get the same error message from all of them.

That’s odd. That would seem to suggest that the Panda build you installed was compiled with a different type of Python build than the libRocket bindings.

There’s a chance this could be something funky with my system. I was running a version of Panda I’d compiled from source for a while to test out Collada support, and my intent was to add libRocket to that, so I downloaded a copy of libRocket, compiled and installed that too. However when I came to run makepanda again, it didn’t find librocket, so I decided to go back to the debs which I’d gathered included it. Unfortunately with both makepanda and librocket not having uninstallers, I had to go through and rm them by hand. Pretty sure I got everything, and they both went into /usr/local prefix, whereas the debs seem to just go into /usr. Anyway, just thought I’d explain what I’ve done recently in case that could’ve messed something up.

I am having a similar issue. I have the last dev version of panda3d installed from the deb package, Ubuntu Trusty. I ran an example code and python complained that it could not find libboost_python-py27a.so
I tried to solve by installing the libboost-python package and now it complains that

I am not sure what went wrong. Interestingly, before the current version of panda3d, I installed the 1.8.1 version from sources, then removed it via rm, and installed this latest version. I never installed librocket though.

Also:

Further on this topic. It seems that there is some incompatibility somehow.

According to these pages where the same error was reported to occurr in other applications
https://sourceware.org/bugzilla/show_bug.cgi?id=11051
http://www.esrf.eu/mail_archives/tango/archive/msg04341.html

the error appears because the boost was compiled with a python interpreter that set Py_UNICODE_SIZE to 2,
while evidently the version installed in my computer (python2.7.6) has the above macro set to 4. I installed Ubuntu 14.04 less than a month ago, so this must be some recent settings.

I am wondering if there is a way to get around this problem.