UFO: Alien Invasion
Loading...
Searching...
No Matches
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"
Include dependency graph for ui_node_image.cpp:

Go to the source code of this file.

Macros

#define EXTRADATA_TYPE   imageExtraData_t
#define EXTRADATA(node)
#define EXTRADATACONST(node)

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.
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

◆ EXTRADATA

#define EXTRADATA ( node)
Value:
#define EXTRADATA_TYPE
#define UI_EXTRADATA(NODE, TYPE)
Definition ui_nodes.h:185

Definition at line 51 of file ui_node_image.cpp.

◆ EXTRADATA_TYPE

#define EXTRADATA_TYPE   imageExtraData_t

Definition at line 50 of file ui_node_image.cpp.

◆ EXTRADATACONST

#define EXTRADATACONST ( node)
Value:
#define UI_EXTRADATACONST(NODE, TYPE)
Definition ui_nodes.h:187

Definition at line 52 of file ui_node_image.cpp.

Function Documentation

◆ UI_ImageAlignBoxInBox()

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().

◆ UI_RegisterImageNode()