User Interface Macros – Take On Helicopters

From Bohemia Interactive Community
Jump to navigation Jump to search
m (revert + fix)
Tag: Undo
m (Text replacement - " ( *class [a-zA-Z0-9_]+): *([a-zA-Z0-9_]+ *) " to " $1 : $2 ")
Line 64: Line 64:
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
//--- Control inherited from RscText base class
//--- Control inherited from RscText base class
class textColorG: RscText
class textColorG : RscText
{
{
};
};

Revision as of 10:57, 6 December 2023

Take On Helicopters offers unbinarized user interface macros and parent classes for anybody who wants to include them in their Config.cpp or Description.ext.

Knowledge of PreProcessor Commands is required for use.

defineDIKCodes.inc

#include "\hsim\UI_H\hpp\defineDIKCodes.inc"

DIK codes of every keyboard key. Useful for User Interface Event Handlers and button shortcuts.

Sample code

shortcuts[] = {INPUT_CTRL_OFFSET + DIK_P}; //--- Button is activated when Ctrl+S is pressed


defineResincl.inc

#include "\hsim\UI_H\hpp\defineResincl.inc"

Latest defined constants for use in Display and Control classes. Amongst others contains control types, colors, grids

Sample code

style = ST_LEFT + ST_MULTI; //--- Text in control can contain multiple lines and is alligned to left


defineCommon.inc

Requires defineResincl.inc

#include "\hsim\UI_H\hpp\defineCommon.inc"

Game specific grids, colors, text sizes etc.

Sample code

//--- Control position alligned to defined grid
x = 1 * GUI_GRID_W + GUI_GRID_X;
y = 18 * GUI_GRID_H + GUI_GRID_Y;
w = 10 * GUI_GRID_W;
h = 1 * GUI_GRID_H;


rscCommon.inc

Requires defineResincl.inc and defineCommon.inc

#include "\hsim\UI_H\hpp\rscCommon.inc"

Basic parent classes.

Sample code

//--- Control inherited from RscText base class
class textColorG : RscText
{
};