CS::Utility::iHUDManager Struct Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
CS::Utility::iHUDManager Struct Reference

A generic tool managing the display of a minimal text-based HUD, eg for applications implementing CS::Utility::DemoApplication or providing a user interface through the keyboard. More...

`#include <ivaria/hudmanager.h>`

Inheritance diagram for CS::Utility::iHUDManager:

List of all members.

## Public Member Functions
virtual bool | GetEnabled () const =0
| Get whether or not the HUD is displayed.
virtual iStringArray * | GetKeyDescriptions ()=0
| Return the array of string describing the available user keys (eg `'d: toggle debug mode'`).
virtual iStringArray * | GetStateDescriptions ()=0
| Return the array of string describing the state of the application (eg `'Debug mode enabled'`).
virtual void | SetEnabled (bool enabled)=0
| Set whether or not the HUD will be displayed.
virtual void | SwitchKeysPage ()=0
| Switch to the next page describing the list of available keyboard keys.
virtual void | Write (int x, int y, int fg, int color, const char *str,...) const =0
| Display a 2D text.
virtual void | WriteShadow (int x, int y, int color, const char *str,...) const =0
| Display a 2D text with a shadow.

## Detailed Description

A generic tool managing the display of a minimal text-based HUD, eg for applications implementing CS::Utility::DemoApplication or providing a user interface through the keyboard.

The HUD consists of the Crystal Space logo, the list of available keyboard and mouse actions that can be used to interact with the demo, and a list of strings describing the current state of the application.

You need to setup or update the list of keys and current states (keyDescriptions and stateDescriptions) whenever they change. The description of the state is augmented with informations such as the current Frames Per Second.

Definition at line 52 of file hudmanager.h.

## Member Function Documentation

virtual bool CS::Utility::iHUDManager::GetEnabled | ( |  | ) | const`[pure virtual]`

Get whether or not the HUD is displayed.

If not enabled, then this manager will not be displayed nor active at all.

virtual iStringArray* CS::Utility::iHUDManager::GetKeyDescriptions | ( |  | ) | `[pure virtual]`

Return the array of string describing the available user keys (eg `'d: toggle debug mode'`).

You can manipulate this array in order to define the list of keys to be displayed. By default the array is filled with the keys available to move the camera. You can call iStringArray::Empty() if you don't want these keys to be displayed.

virtual iStringArray* CS::Utility::iHUDManager::GetStateDescriptions | ( |  | ) | `[pure virtual]`

Return the array of string describing the state of the application (eg `'Debug mode enabled'`).

You can manipulate this array in order to define the list of state descriptions to be displayed.

virtual void CS::Utility::iHUDManager::SetEnabled | ( | bool | enabled | ) | `[pure virtual]`

Set whether or not the HUD will be displayed.

If not enabled, then this manager will not be displayed nor active at all.

virtual void CS::Utility::iHUDManager::SwitchKeysPage | ( |  | ) | `[pure virtual]`

Switch to the next page describing the list of available keyboard keys.

This is useful when the list of available keyboard keys is too big and needs to be split in several different pages.

virtual void CS::Utility::iHUDManager::Write | ( | int | x,
|  | int | y,
|  | int | fg,
|  | int | color,
|  | const char * | str,
|  |  | ...
| ) |  | const`[pure virtual]`

Display a 2D text.

Additional parameters can be defined, they will be formated into the text string by using the cs_snprintf()-style formatting directives.

virtual void CS::Utility::iHUDManager::WriteShadow | ( | int | x,
|  | int | y,
|  | int | color,
|  | const char * | str,
|  |  | ...
| ) |  | const`[pure virtual]`

Display a 2D text with a shadow.

Additional parameters can be defined, they will be formated into the text string by using the cs_snprintf()-style formatting directives.

The documentation for this struct was generated from the following file:

- ivaria/hudmanager.h