Is there an info on making a GUI??Not sure if you need a script for that
digiman
Is there an info on making a GUI??Not sure if you need a script for that
digiman
Well GUI stands for Graphical User Interface, the question is what do you need to interface with and how will you do it.
Simplest is just hooking up buttons to actions with logic bricks.
If you need to get user text input then python is very helpful.
And if your game requires tons of GUI, then it would be good to make your own python scripts to help automate it. (like adding text objects in a column, or getting and returning user entered text)
As of now, there is no simple way of doing a complex GUI within the BGE. A button is easy, a menu is okay, but complex things like sliders, combo box, text field will probably require some thought (and some python)
The lack of proper font rendering support discourages all other efforts, because no matter what you make, the blurry text makes it look like crap.
In 2.5 you can draw to the screen with python, download the alpha and have this script run once
from BGL import *
import GameLogic as gl
def pyOpenGLFunc():
glMatrixMode(GL_PROJECTION)
glLoadIdentity();
glOrtho(-50.0, 50.0, -25.0, 25.0, -1.0, 1.0)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
glDisable(GL_LIGHTING)
glPushMatrix()
glColor4f(0.0, 0.0, 1.0, 0.8)
glRotatef(gl.spin, 0.0, 0.0, 1.0)
glRectf(-15.0, -15.0, 15.0, 15.0)
gl.spin += 2.0
if gl.spin > 360:
gl.spin -= 360
glPopMatrix()
if not hasattr(gl, "spin"):
gl.spin = 0.0
gl.getCurrentScene().post_draw = [pyOpenGLFunc]
edit: this script is an example by Moguri, I’m still trying to understand it.
That’s an exiting new feature. There are a lot of GUI frameworks written in python/pygame, though I image one would need to redirect mouse/keyboard input when needed.
Are there plans to add this at some point?
I don’t know, but there certainly should be:
Text is essential no matter the game type.