UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_node_image.cpp File Reference

The pic behaviour allow to draw an image or a part of an image into the GUI. It provide some layout properties. We can use it like an active node (mouse in/out/click...) but in this case, it is better to use nodes with a semantics (like button, or checkbox). More...

#include "../ui_nodes.h"
#include "../ui_parse.h"
#include "../ui_behaviour.h"
#include "../ui_render.h"
#include "ui_node_image.h"
#include "ui_node_abstractnode.h"
#include "../../client.h"
#include "../../../common/scripts_lua.h"

Go to the source code of this file.

Macros

#define EXTRADATA_TYPE   imageExtraData_t
 
#define EXTRADATA(node)   UI_EXTRADATA(node, EXTRADATA_TYPE)
 
#define EXTRADATACONST(node)   UI_EXTRADATACONST(node, EXTRADATA_TYPE)
 

Functions

static void UI_ImageAlignBoxInBox (vec2_t outerBoxPos, vec2_t outerBoxSize, vec2_t innerBoxSize, align_t align, vec2_t innerBoxPos)
 Get position of a inner box inside an outer box according to align param. More...
 
void UI_RegisterImageNode (uiBehaviour_t *behaviour)
 

Detailed Description

The pic behaviour allow to draw an image or a part of an image into the GUI. It provide some layout properties. We can use it like an active node (mouse in/out/click...) but in this case, it is better to use nodes with a semantics (like button, or checkbox).

image aircraft_return
{
src ui/buttons_small
pos "550 410"
texl "0 32"
texh "16 48"
[..]
}

Definition in file ui_node_image.cpp.

Macro Definition Documentation

#define EXTRADATA (   node)    UI_EXTRADATA(node, EXTRADATA_TYPE)

Definition at line 51 of file ui_node_image.cpp.

Referenced by uiImageNode::draw(), and uiImageNode::onLoaded().

#define EXTRADATA_TYPE   imageExtraData_t

Definition at line 50 of file ui_node_image.cpp.

Referenced by UI_RegisterImageNode().

#define EXTRADATACONST (   node)    UI_EXTRADATACONST(node, EXTRADATA_TYPE)

Definition at line 52 of file ui_node_image.cpp.

Function Documentation

static void UI_ImageAlignBoxInBox ( vec2_t  outerBoxPos,
vec2_t  outerBoxSize,
vec2_t  innerBoxSize,
align_t  align,
vec2_t  innerBoxPos 
)
static

Get position of a inner box inside an outer box according to align param.

Todo:
Generic function, move it outside.
Parameters
[in]outerBoxPosPosition of the top-left corner of the outer box.
[in]outerBoxSizeSize of the outer box.
[in]innerBoxSizeSize of the inner box.
alignAlignment of the inner box inside the outer box.
[out]innerBoxPosPosition of the top-left corner of the inner box.

Definition at line 90 of file ui_node_image.cpp.

References Com_Error(), and ERR_FATAL.

Referenced by uiImageNode::draw().