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_render.h"
#include "ui_node_image.h"
#include "ui_node_abstractnode.h"
#include "../../client.h"
Go to the source code of this file.
Defines | |
#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_ImageNodeLoaded (uiNode_t *node) |
Handled after the end of the load of the node from the script (all data and/or child are set). | |
void | UI_ImageNodeDraw (uiNode_t *node) |
void | UI_RegisterImageNode (uiBehaviour_t *behaviour) |
Variables | |
static const value_t | properties [] |
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).
pic aircraft_return { image ui/buttons_small pos "550 410" texl "0 32" texh "16 48" [..] }
Definition in file ui_node_image.c.
#define EXTRADATA | ( | node | ) | UI_EXTRADATA(node, EXTRADATA_TYPE) |
Definition at line 48 of file ui_node_image.c.
#define EXTRADATA_TYPE imageExtraData_t |
Definition at line 47 of file ui_node_image.c.
#define EXTRADATACONST | ( | node | ) | UI_EXTRADATACONST(node, EXTRADATA_TYPE) |
Definition at line 49 of file ui_node_image.c.
void UI_ImageNodeDraw | ( | uiNode_t * | node | ) |
Definition at line 81 of file ui_node_image.c.
References uiNode_s::color, EXTRADATA, image_s::height, uiNode_s::image, R_Color(), scale, uiNode_s::size, uiNode_s::state, UI_DrawNormImage(), UI_GetNodeAbsPos(), UI_GetReferenceString(), UI_LoadImage(), Vector2Copy, Vector2Set, VectorScale, and image_s::width.
Referenced by UI_RegisterImageNode().
static void UI_ImageNodeLoaded | ( | uiNode_t * | node | ) | [static] |
Handled after the end of the load of the node from the script (all data and/or child are set).
Definition at line 54 of file ui_node_image.c.
References Com_DPrintf(), DEBUG_CLIENT, EXTRADATA, image_s::height, uiNode_s::image, uiNode_s::onClick, uiNode_s::onMiddleClick, uiNode_s::onMouseEnter, uiNode_s::onMouseLeave, uiNode_s::onRightClick, uiNode_s::onWheel, uiNode_s::onWheelDown, uiNode_s::onWheelUp, uiNode_s::size, UI_GetPath(), UI_LoadImage(), and image_s::width.
Referenced by UI_RegisterImageNode().
void UI_RegisterImageNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 162 of file ui_node_image.c.
References uiBehaviour_s::draw, EXTRADATA_TYPE, uiBehaviour_s::extraDataSize, uiBehaviour_s::loaded, uiBehaviour_s::name, uiBehaviour_s::properties, UI_ImageNodeDraw(), and UI_ImageNodeLoaded().
const value_t properties[] [static] |
{ {"preventratio", V_BOOL, UI_EXTRADATA_OFFSETOF(imageExtraData_t, preventRatio), MEMBER_SIZEOF(imageExtraData_t, preventRatio)}, {"mousefx", V_BOOL, UI_EXTRADATA_OFFSETOF(imageExtraData_t, mousefx), MEMBER_SIZEOF(imageExtraData_t, mousefx)}, {"texh", V_POS, UI_EXTRADATA_OFFSETOF(imageExtraData_t, texh), MEMBER_SIZEOF(imageExtraData_t, texh)}, {"texl", V_POS, UI_EXTRADATA_OFFSETOF(imageExtraData_t, texl), MEMBER_SIZEOF(imageExtraData_t, texl)}, {"src", V_CVAR_OR_STRING, offsetof(uiNode_t, image), 0}, {NULL, V_NULL, 0, 0} }
Definition at line 143 of file ui_node_image.c.