50#define EXTRADATA_TYPE imageExtraData_t
51#define EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE)
52#define EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE)
64 }
else if (node->
image) {
94 innerBoxPos[0] = outerBoxPos[0];
97 innerBoxPos[0] = outerBoxPos[0] + (outerBoxSize[0] * 0.5) - (innerBoxSize[0] * 0.5);
100 innerBoxPos[0] = outerBoxPos[0] + outerBoxSize[0] - innerBoxSize[0];
105 innerBoxPos[1] = outerBoxPos[1];
108 innerBoxPos[1] = outerBoxPos[1] + (outerBoxSize[1] * 0.5) - (innerBoxSize[1] * 0.5);
111 innerBoxPos[1] = outerBoxPos[1] + outerBoxSize[1] - innerBoxSize[1];
114 innerBoxPos[1] = outerBoxPos[1];
143 if (node->mousefx && node->
state) {
146 color[3] = node->
color[3];
171 const float ratio = (float) image->
width / (
float) image->
height;
191 if (node->mousefx && node->
state) {
200 behaviour->
name =
"image";
void R_Color(const vec4_t rgba)
Change the color to given value.
void onLoaded(uiNode_t *node) override
Handled after the end of the load of the node from the script (all data and/or child are set).
void draw(uiNode_t *node) override
Draws the image node.
Primary header for client.
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
void Com_Error(int code, const char *fmt,...)
align_t
We need this here for checking the boundaries from script values.
Header for lua script functions.
bool Q_strnull(const char *string)
node behaviour, how a node work
Atomic structure used to define most of the UI.
struct uiAction_s * onWheelDown
struct uiAction_s * onMouseLeave
struct uiAction_s * onWheel
struct uiAction_s * onMiddleClick
struct uiAction_s * onClick
struct uiAction_s * onRightClick
struct uiAction_s * onMouseEnter
struct uiAction_s * onWheelUp
#define UI_RegisterNodeProperty(BEHAVIOUR, NAME, TYPE, OBJECTTYPE, ATTRIBUTE)
Initialize a property.
#define UI_RegisterExtradataNodeProperty(BEHAVIOUR, NAME, TYPE, EXTRADATATYPE, ATTRIBUTE)
Initialize a property from extradata of node.
void * UI_SWIG_TypeQuery(const char *name)
This function queries the SWIG type table for a type information structure. It is used in combination...
void UI_GetNodeAbsPos(const uiNode_t *node, vec2_t pos)
Returns the absolute position of a node.
SharedPtr< uiNode > UINodePtr
static const vec3_t scale
void UI_RegisterImageNode(uiBehaviour_t *behaviour)
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.
const char * UI_GetPath(const uiNode_t *node)
Return a path from a window to a node.
const char * UI_GetReferenceString(const uiNode_t *const node, const char *ref)
const struct image_s * UI_LoadImage(const char *name)
Searches for an image in the image array.
void UI_DrawNormImage(bool flip, float x, float y, float w, float h, float sh, float th, float sl, float tl, const image_t *image)
Draw a normalized (to the screen) image.
#define Vector2Set(v, x, y)
#define VectorScale(in, scale, out)
#define Vector2Copy(src, dest)