from spw.gui import GUI, Context
text = GUI.input("textbox", (70,10,100,30))
if GUI.toggle("show", (290,10,10,10)):
if GUI.button("quit", "Quit", (190,30,100,100)):
options = "new", "open", "save"
action = GUI.menu("file", "FILE", (10,10,50,30), options)
if action is not None: print action
context = Context(pygame.display.set_mode((320,240)))
window = Window()
e = pygame.event.wait()
if e.type == pygame.QUIT: break
with context as canvas:
GUI.draw(window, canvas, e)
Wednesday, August 26, 2009
SPW does stupid easy GUI screens.
I would like an easy way to write GUI screens for my games... one function to draw the GUI, handle GUI state, and respond to GUI events. No widget graphs, no parent child relationships, no callbacks. It can be done. The code below uses a new GUI module in the SPW library. Many more widgets are required, as at the moment there are only input boxes, buttons, toggles and menu widgets.
MiddleMan: A Pub/Sub and Request/Response server in Go. This is my first Go project. It is a rewrite of an existing Python server, based o...
So, you've created a car prefab using WheelCollider components, and now you can apply a motorTorque to make the whole thing move along. ...
UniWeb now includes a tiny embedded web server which you can use to do crazy things. That is all.
I've been working on something new. I get a lot of projects where I have to add multiuser functionality. Finally I've made the jump ...
The NetworkManager instantiates a Player prefab. This is your Player Object. In a two player game, your GameObjects exist conceptually in ...
As part of my quest to create amazing procedural spacecraft, I made a greebling tool for Unity. Here are the before and after screengrabs. ...
Some favourite quotes from Ron Jeffries, one of the three founders of the Extreme Programming software development methodology... Often yo...
In my efforts to write a malloc-free network library for Unity3D, I discovered that BinaryReader and BinaryWriter perform malloc operations ...
I use the var keyword everywhere. Someone told me today that this is a bad practice, because "sometimes you can't tell what type it...