Book Image

CryEngine Game Development Blueprints

Book Image

CryEngine Game Development Blueprints

Overview of this book

Table of Contents (22 chapters)
CRYENGINE Game Development Blueprints
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing a game menu system in C++


Now that we have all of the Flash UI content created and ready to go, it's time to connect it to the C++ layer of CRYENGINE via a game menu system. This system is very basic; however, it is quite powerful when communicating with ActionScript, such as when responding to events (fscommands). All we need is a small class that will listen to all of the events that Flash dispatched to us via fscommands. We will then use this listener mechanic to respond to various events, helping us develop a framework to display our various game menus.

So let's see how this is done:

  1. Create a new header file called CGameUIListener.h that will be used to declare our game's menu system (Flash UI listener). Create a class called CGameUIListener that publicly inherits from IUIElementEventListener. This will allow us to receive all events from particular UI elements. The code should look as follows:

    #pragma once
    
    #include <IFlashUI.h>
    
    
    ///////////////////////////////////...