I’m working on a GUI system to be used within the Blender Game Engine.
Currently it’s on its BETA stage, that means that it works but it’s not perfect!
I’m using BGL to handle the drawing, BLF for the fonts (and also for the fancy text shadows :))
and VideoTexture to handle the images.
Here’s a list of supported components (or controls):
Button
CheckBox
Container (Panel)
BaseControl
DropDown
Image Viewer
Label
List Box
Progress Bar
RadioButton
Slider
Spinner
Edit Box (Text Edit)
The main feature is Component Skinning, you can make your own themes with your own textures.
EDIT:
New Features:
Layout System
New Event System
Here’s an example of a GUI without skins:
Now this is how it looks like with a nice skin:
If you want to see it in action, here’s a video:
PS: Not everything works perfectly, like I said before, but you can make awesome GUIs with it :yes:
So I am on.
How i can find out what exactly is availible.
For Example:
How i place an Image?
How i change the Mousevent from Mouse_Hold to … lets say: Mouse_over or Mouse_Blur or Mouse_Out… ?
And… can i change Dynamicly?
Can you put up the sources for those example UI shown in the images?
I am unable to get these to work:
Checkbox, RadioButton and VerticalScroll
And is there any variables that we could use to change the panel’s position in real-time?
so that we can drag the “Form” by mouse.
I’ve been using sender.bounds[0] and sender.bounds[1] but there seems to be a problem where the attached
components lags behind when the form is moved. Is there anyway around this?
Just testing this out on my Mac with Blender 2.75. Had to change “pgui.py” in the src folder to “PGUI.py” to keep from getting: AttributeError: ‘module’ object has no attribute ‘PGUI’
Looking forward to testing further to keep me from having to develop my own gui from scratch.
@DownshiftDX
Thanks for the comment.
pgui.py is supposed to be PGUI.py. But apparently GitHub doesn’t know the difference between lower case and upper case
Here’s how the new GUI style looks like:
I also want to warn that the skinning system is currently broken due to VideoTexture issues. I hope they fix it soon!
@BluePrintRandom
I’m doing some research on how to render the GUI onto a plane for example. (No success at all)
I tried VideoTexture, but I didn’t find anything helpful on the docs…
I was trying to find an old demo that I saw a looong time ago, It was a torus and you could draw on it, everything realtime on the BGE, that’s what I wanted.
Yes I saw your 3d widgetry demo, and it’s really nice!
@@BluePrintRandom
That’s a nice idea but how? I found the bge.texture.ImageViewport but that would require the scene to be overlayed and also would render the whole screen instead of the GUI…
from pgui import *
from bge import logic as g
def main(cont):
o = cont.owner
if "init" not in o:
o["mgr"] = PManager.new()
mgr = o["mgr"] # I don't wanna write o["mgr"] every single time :P
ddown = mgr.addControl("myDropdownList", PDropDown.new(bounds=[140, 10, 90, 20], text="Language"))
ddown.toolTipText = "Select a programming language from the list"
ddown.items = ["Python", "Java", "C++", "Lua"]
o["init"] = 1
mgr.bind()
else:
o["mgr"].update()
I’m still thinking about how can I make 3D GUIs. I can’t promise anything but I’m trying my best