Basic dialog boxes (another wheel reinvented)
Posted: Mon Feb 02, 2009 3:53 pm
When I finished the pairs game I posted earlier I was dissatisfied with the way that dialogs were handled. To many magic numbers being thrown around - which is never a good sign. So here's a simple dialog system that uses an image as a dialog and puts it to the centre of the screen and awaits a click on one of the buttons (which are just designated rectangles in the image). It also casts a transparent shadow.
Designed to handle nothing more than "new game / resume game / quit" style dialogs. See the dialog and click on a button.
There is a variable, dialogs_debug, which when set to true will draw a red box around the button and print the button's name.
I realise that this is the umpteenth half arsed implementation of a dialog box but that's what I like about Lua. It's easy to knock out your own tools
Designed to handle nothing more than "new game / resume game / quit" style dialogs. See the dialog and click on a button.
There is a variable, dialogs_debug, which when set to true will draw a red box around the button and print the button's name.
I realise that this is the umpteenth half arsed implementation of a dialog box but that's what I like about Lua. It's easy to knock out your own tools