Im new to panda3d and i was so excited to find out that panda3d integrated librocket. Problem - there was no sample of how to initialize and use library. From other librocket thread i put together code written by other people to tiny working demo:
code:
from direct.showbase.ShowBase import ShowBase
from panda3d import rocket
from panda3d.rocket import *
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
rocket.LoadFontFace("./data/Delicious-Roman.otf")
rocket.LoadFontFace("./data/Delicious-Bold.otf")
rocket.LoadFontFace("./data/Delicious-BoldItalic.otf")
rocket.LoadFontFace("./data/Delicious-Italic.otf")
r = RocketRegion.make('pandaRocket', base.win)
r.setActive(1)
ih = RocketInputHandler()
base.mouseWatcher.attachNewNode(ih)
r.setInputHandler(ih)
context = r.getContext()
document = context.LoadDocument("./data/demo.rml");
if document:
document.Show();
app = MyApp()
app.run()