Game Development Reference
In-Depth Information
menu, the menus controller would be handling the input relating to cycling through menu
options and accepting or changing values presented by the menu.
class controller
{
public:
controller(element& element);
virtual void Create();
virtual bool HandleInput(float deltaTime, const input::input_state& inputState);
protected:
element& m_element;
private:
controller(const controller&) = delete;
controller(const controller&&) = delete;
controller& operator = (const controller&) = delete;
};
Thiscoversthebaseimplementationforuserinterfaceelements.Auserinterface element is
acomplexfeaturethatmaybegame-specificsuchasahealthbaroraradar.Themotivation
behind having a base class forthese features is to create a consistent framework that would
give us the flexibility to group user interface features and perform actions on them. One
common situation is that certain elements of a user interface need to be hidden depending
on the state of the player, or if the player is in a combat situation his heads up display may
be significantly different than when he is engaged in a conversation with another character
in the game.
Inthenextchapterwewilllookathowtoapplytheuserinterface element modelviewcon-
troller design pattern by implementing a game's heads up display (HUD).
Search WWH ::




Custom Search