About
p3doverlays, or Panda Overlays, allows you to use familiar screen-space coordinates and pixel-perfect rendering to create GUI/HUD elements in Panda 3D. The aim of this project is to create a generic ‘base layer’ for GUI/HUD libraries to build atop. Support for ‘slicing’ textures is also included, in order to create resizable elements (such as scrollbars and rounded-corner windows).
I find that one of the reasons OGRE 3D has so many GUI libraries to choose from, and Panda 3D has so few, is because of the lack of support for pixel-based rendering in Panda. Hopefully this project will at least inspire some change.
Creating crisp, pixel-positioned text and geometries takes only a few lines of code:
...
pixel2d = PixelNode('g2d')
box1 = Overlay(color=Vec4(.9, .7, .7, 1))
box1.reparentTo(pixel2d)
box1.setZIndex(-1)
box1.setPos(50, 50)
myFont = TextOverlay.loadFont('res/Aller_Rg.ttf', size=12)
text = TextOverlay(msg="Lorem ipsum...", font=myFont,
color=Vec4(0.2,0.2,0.2,1))
text.reparentTo(pixel2d)
pad = 5
x, y = box1.getPos()
text.setPos(x+pad, y+pad)
w, h = text.getSize()
box1.setSize(w+pad*2, h+pad*2)
...
Code Samples & Tutorials
p3doverlays.googlecode.com/svn/t … mples.html
Class Documentation
p3doverlays.googlecode.com/svn/t … asses.html
Downloads
code.google.com/p/p3doverlays/downloads/list
Project Home