• entries
    743
  • comments
    1924
  • views
    580443

Pod GUI

Sign in to follow this  

141 views



Finally got to starting work on the GUI for Pod tonight and have had a very productive er, many hours.

The screenshot doesn't do any justice to how cool this is, so there is an OBLIGATORY MOVIE SHOWING IT OFF for your viewing pleasure. About 1.1 meg WMV in a zip as usual. Very poor quality, but hey.

It is all nicely datadriven - the current XCS file that defines the test GUI looks like this:


font="Resource\\font.spf";

game_options
{
pos="512,384";
size="500,350";

escape="close";

controls
{

control { type="label"; pos="20,20"; text="Options"; }
control { type="textbtn"; pos="30,80"; text="Graphics"; action="goto graphics"; }
control { type="textbtn"; pos="30,100"; text="Sounds"; action="goto sounds"; }
control { type="textbtn"; pos="30,120"; text="Continue"; action="close"; }

}
}

graphics
{
pos="105,105";
size="200,200";

escape="root";

controls
{

control { type="label"; pos="20,20"; text="Graphics"; }
control { type="textbtn"; pos="30,80"; text="Resolution"; action="root"; }
control { type="textbtn"; pos="30,100"; text="Filter"; action="root"; }

}
}

sounds
{
pos="750,520";
size="400,400";

escape="root";

controls
{

control { type="label"; pos="20,20"; text="Sounds"; }
control { type="textbtn"; pos="30,80"; text="Hardware"; action="root"; }
control { type="textbtn"; pos="30,100"; text="Volume"; action="root"; }

}
}





You activate the GUI in game by calling an Activate() method and specifying the root window to activate.

The window then zooms out of the middle of the screen and its contents fade into view.

When you click a link that takes you to another window, the contents fade out, the window morphs to its new position and size and the new contents fade into view.

Take a look at the video to see what I mean.

At the moment, the only supported controls are labels and text buttons. The buttons highlight when you mouse over.

The whole point of the concept of a "root" menu is that there will be a different "main menu" on the title screen to the in game pause menu, but they can both link to all the same options menus. Processing the options will be handled in the main Engine class so all options will be available regardless of the current mode.

All the behaviour in the video is defined in the script - to set up links to different windows and to have escape take you to another specified window or exit the GUI requires no hard-coding.

The GUI communicates with the main Engine class via a GUIListener interface. Eventually, it will be possible to script for a control to send a text-string to the listener so that internal behaviour in the program can be achieved.

I need to set up a control with a text label and up-down buttons on either side that allow you to scroll through options. This will cover pretty much every option I need to support.

The only things I can think off that might not be covered would be text input and defining controls, but I'll cross that when I come to it.

All in all, I think it is looking pretty polished and above and beyond the attention to detail I've ever put into a game GUI before so I'm pleased. The code is a bit hacky internally, but it is robust enough and has a fairly simple public interface so I can always rewrite it later if it gets on my tits enough or fails to scale up to whatever I might need.

Comments, as always, welcome.
Sign in to follow this  


6 Comments


Recommended Comments

It looks very nice.

The only thing that would worry me is usability. I don't imagine I would enjoy chasing config windows. So while having the windows warp around looks cool - I would be tempted to drop it. The moving part I mean - I think the shape morphing would work fine.

Share this comment


Link to comment
Quote:
Original post by rip-off
It looks very nice.

The only thing that would worry me is usability. I don't imagine I would enjoy chasing config windows. So while having the windows warp around looks cool - I would be tempted to drop it. The moving part I mean - I think the shape morphing would work fine.


Yeah, I'm really just testing (or "showing off" as it is more commonly known) the morphing feature at the moment.

Since I posted the video, the root menu zooms up from the middle of the bottom of the screen which looks quite nice, and vanishes back down there when returning to the game, but I agree sub-windows should all be screen centre in the final game. The morphing will still look pretty cool then I think.

Cheers for the comments.

Share this comment


Link to comment
Quote:
Original post by Mike.Popoloski
ENTRY NOMINATED FOR JOURNAL LAND PICK OF THE WEEK!


Even if it doesn't get it, I can now add "Journal-land Pick of the Week Nominee, 2008" to my signature.

I'd like to thank the Academy... [smile]

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now