Skip to main content
gamedev.net
🔒 Locked

Scripted menu design

Started by Andybean9 0 replies 700+ views
Original Post
Andybean9
Andybean9
Hi everyone, I just wanted to get some advice on the design of a scripted menu system. These are the ideas that I have so far. - From the LUA script you will be able to create different widgets for the menu: Clickable buttons, static text, and images. - When you click on a button, the lua script will figure out which button it is and from there will have a callback stored for the button and will call that callback function, which would call another menu, like the Options or something like that. - I also would like this same system to be used for in game pause menus and things like that, and perhaps the HUD as well. So you will be able to tell the system how big the menu area is and then you can place your buttons, text, images, whatever in that area. So how does that sound? What i'm having trouble grasping is how my c++ code should handle this in the best manner. My thoughts were when the project starts the program will load MainMenu.lua no matter what, so that file would have to be there. Then from there the MainMenu script would control the rest of the flow until the button that starts the game is called. Any suggestions or ideas would be very welcome and very useful! Thanks. Andrew
nife
nife
I can suggest you to look at FarCry's gui (just download the demo, if you haven't got the full version, that's what I did). Although you cannot see the engine's code, you can get a good idea of how to script the whole thing. IMO I think the CryEngine's gui design is pretty good.

BTW. the CryEngine scripting is done in Lua, so you should understand it quite clearly ;)

The basic idea for their design is also callback functions, lying in the gui elements' tables.
Killers don't end up in jailThey end up on a high-score!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.