O'Reilly logo

CryENGINE Game Programming with C++, C#, and Lua by Ruan Pearce-Authers, Carl-Filip Lundgren

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a main menu

Now that we have a basic understanding of the UI flowgraph implementation, let's get started with creating our very own main menu.

Creating menu elements

The first thing we need to do is create our UI element definition in order to provide the engine with a means for loading our exported SWF file.

To do so, create a new XML document in Game/Libs/UI/UIElements/ named MainMenuSample.xml. The bare minimum code required for our menu can be seen in the following code:

<UIElements name="Menus"> <UIElement name="MainMenuSample" mouseevents="1" keyevents="1" cursor="1" controller_input="1"> <GFx file="MainMenuSample.swf" layer="3"> <Constraints> <Align mode="dynamic" halign="left" valign="top" scale="1" max="1"/> </Constraints> </GFx> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required