Game Engine Interfaces

I have seen a tutorial floating around on how to make buttons and menus for your python scripts with the look and feel of the blender interface.

Can this be done in the game engine as well?

In other words, if I make a game with the Blender game engine, can I use these buttons and menus as a user interface or do I have to create my own?

d

I don’t know, but it’s highly unlikelly.

The way that is made for blender is through the Tkinter toolkit, but I have never seen that type of GUI working in game.

Just stick with what works and make your own UI:

http://blenderartists.org/forum/showthread.php?t=73322

What I had hoped is since I could import and use the BGL library to make a ui for a python script, I could use the same to make the interface in the game engine.

For instance, If I had a model of a car in the game engine and I clicked on that car, I would want a little menu to pop-up with some controls on it. Preferably one that did not rotate with the scene but would be stationary with the camera.

Can BGL do this, or is it only a full screen ui like in this example: http://feeblemind.tuxfamily.org/dotclear/share/blender-lg-02-en.pdf.

d

The Blender Game Engine predominantly uses functions from 3 modules:

  • GameLogic
  • Rasterizer
  • GameKeysYou can’t use many functions from the Blender module (other than some number crunching functions, I think), because blender and the GE are two different things. I doubt that you can call something like a draw function from the Blender module, and have it work in the game engine, because the game engine uses it’s own draw functions to put things on the screen (including UI’s). You can still try running some tests and see if you get the desired result, but I doubt it will work.

Ah well… there it is.

It was worth a try, thanks for all the info, I’ll post if I figure anything out but so far nothing.

d

What I had hoped is since I could import and use the BGL library to make a ui for a python script, I could use the same to make the interface in the game engine.

I think that would take some special work with the game engine code. It’s pretty easy to make your own widgit set unless your trying to do something really complicated, but it’s easy to put text up, put a plane for background with a special texture, and make some buttons. Buttons are just planes with a mouse over sensor in combination with a left click sensor.

just make the menu a billboarded plane.