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:
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 calledCGameUIListener
that publicly inherits fromIUIElementEventListener
. This will allow us to receive all events from particular UI elements. The code should look as follows:#pragma once #include <IFlashUI.h> ///////////////////////////////////...