ui_node_image.c 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_render.h"
#include "ui_node_image.h"
#include "ui_node_abstractnode.h"
#include "../../client.h"
Include dependency graph for ui_node_image.c:

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 []

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

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

Definition in file ui_node_image.c.


Define Documentation

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


Function Documentation

void UI_ImageNodeDraw ( uiNode_t node  ) 
Todo:
Center image, or use textalign property

Todo:
convert all pic using mousefx into button.
Todo:
delete mousefx
Todo:
code is duplicated in the ekg node code
Todo:
convert all pic using mousefx into button.
Todo:
delete mousefx

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]
void UI_RegisterImageNode ( uiBehaviour_t behaviour  ) 

Variable Documentation

const value_t properties[] [static]
Initial value:
 {
    
    {"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.


Generated by  doxygen 1.6.2