librocket GUI support

File a bug report on Launchpad with some simple sample code that clearly illustrates the problem. Thanks!

Done

https://bugs.launchpad.net/panda3d/+bug/1013285

Thanx :slight_smile:

Hasn’t the Ubuntu Precise build no support for librocket? I tested it with 3 different .debs, but everytime I got the “ImportError: DLL loader cannot find _rocketcore.”-thing. For now, it’s possible for me to switch to WinXP for a while, but I would be happy to develop under Ubuntu :slight_smile:

Texugo: I do believe this bug is actually already known and has been fixed in the 1.8.1 branch.
I have the same issue. Just waiting for 1.8.1 to be released.

Another question: I need to handle left and right clicks on some element, and I realized that only the left clicks were received by my event listener.
I’m fairly certain the Rocket “click” event checks for every kind of clicks (it has a “button” parameter… doesn’t make much sense if that parameter is bound to always be ‘0’).

Has anyone ever managed to get something else than left clicks from Rocket ?

Hi, I had a few questions for (probably rdb) you guys.

Are the panda3d’s rocket module using a CVS version of Rocket, or the one found at librocket.com/download

The libRocket builds found on the download page are from over a year ago, and are missing several bug fixes that my project would require, is there any chance we could build against a CVS version of libRocket for panda3d 1.8.1? Or should I talk to the libRocket developers about updating the downloads on their page?

In specific the CVS builds of Rocket include these things I’d like:

Clipboard support (github.com/lloydw/libRocket/blo … pboard.cpp)

and (this is direly required for me)

the fix for “textarea” elements to be disabled and still render text: forums.librocket.com/viewtopic.php?f=2&t=766

Thank you,
~powerpup118

Hi again,

I’ve actually found a small workaround for my particular use case of the “textarea” element, so that I no longer require the patch.

I believe it’s still a good idea to update to recent versions of libRocket instead of old builds, I can live without it though.

My apologies for speaking so soon,
~powerpup118

Hi all. I’m running Debian Squeeze and have installed both 1.8 and 1.9, but I’m getting the “ImportError: DLL loader cannot find _rocketcore” that others have reported in this thread.

I also don’t seem to have anything related to rocket in /usr/lib/panda3d

Is there a particular version I should be looking for?

Perhaps your build of Panda3d was not compiled with support for librocket. Which build did you install?

I installed the latest 1.8 and 1.9 packages from panda3d.org:

panda3d1.9_1.9.0+cvs20120923~squeeze613_i386.deb

and

panda3d1.8_1.8.0~squeeze_i386.deb

None of the Precise builds includes rocket:
WARNING: Could not locate thirdparty package rocket, excluding from build

However, you can use the Oneiric builds with precise just as well, and they’re built with librocket.

A sample can be found here: github.com/nemesis13/Azure–Inf … sample.zip

After unpacking start it by running

python test.py

The sample consists of a simple main menu with a few entries, of which “adventure” prints a string to stdout, “quick game”, “options” and “credits” show a full-screen modal dialog with some text on it and “exit”, which quits the application. In the background you should see an airplane hanging around.

The rocket-included debugger is also activated by default. I leave it to the reader to disable it at will. (It’s in test.py)

I hope it helps. If you have questions, just shoot it out.

Here two screenshots of how it’s supposed to look:

PS: please don’t search for the project, it’s paused for at least a few years.

I’m trying to get librocket to work with fonts besides the provided Delicious. The call to LoadFontFace returns True, which the librocket api says means it’s loaded correctly. I just can’t figure out what on earth to put in the font-family designation to get it to render with my own font. Is there some way to query all of the font-familys that the renderer accepts?

This is covered in the librocket manual: librocket.com/wiki/documentation … nual/Fonts

Is there an example of how to do it in python instead of c++? I can’t find any reference to the values WEIGHT_NORMAL or STYLE_NORMAL in the devel python API. If I guess that they’re ints, it crashes with this:

    print LoadFontFace("code/ui/fonts/MyriadPro-Regular.otf","Myriad",1,1)
Boost.Python.ArgumentError: Python argument types in
    _rocketcore.LoadFontFace(str, str, int, int)
did not match C++ signature:
    LoadFontFace(class Rocket::Core::StringBase<char>)

Huh, maybe they don’t expose that through the Python interface then. Perhaps you should instead simply find out what the family name of that font is by examining the font in a tool that can display the metadata of font files?

I figured it out. Librocket only accepts font-family names with spaces in them if you enclose it in double quotes. I was using single quotes, which works in Firefox css, at least.

i wanted to make sure… is Rocket::Core::factory::ClearStyleSheetCache() somehow exposed to python? i cant find it anywhere and its vital for rapid ui development and testing as css files are loaded from cache thus modifications are not reflected in reloaded document.

This is really a libRocket question, I would suggest that you search for the function in the libRocket Python API reference.

right… if only project was not dead-ish. do you happen to have archived copy of librocket documentation by any chance? official page aling with the wiki is down since idk when.

Looks like working for me: librocket.com/wiki/documentation