Custombutton is a button using a skin with a fixed size. We can define every pixels into the texture. It can't be bigger than 256x64, because each row of 64 pixels are used for the button status (normal, hovered, disabled, and the last is not used). More...
#include "../ui_main.h"
#include "../ui_icon.h"
#include "../ui_parse.h"
#include "../ui_font.h"
#include "../ui_input.h"
#include "../ui_render.h"
#include "ui_node_custombutton.h"
#include "ui_node_button.h"
#include "ui_node_abstractnode.h"
Go to the source code of this file.
Defines | |
#define | UI_CUSTOMBUTTON_TEX_HEIGHT 64 |
#define | UI_CUSTOMBUTTON_TEX_WIDTH 256 |
#define | EXTRADATA_TYPE customButtonExtraData_t |
#define | EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE) |
#define | EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE) |
Functions | |
static void | UI_CustomButtonNodeDraw (uiNode_t *node) |
Handles CustomButton draw. | |
void | UI_RegisterCustomButtonNode (uiBehaviour_t *behaviour) |
Variables | |
static const value_t | properties [] |
Custombutton is a button using a skin with a fixed size. We can define every pixels into the texture. It can't be bigger than 256x64, because each row of 64 pixels are used for the button status (normal, hovered, disabled, and the last is not used).
// the button use all the size allowed custombutton button_load { pos "780 130" size "128 64" click { cmd "echo click;" } image ui/multi_buttons2 font f_menubig color "0 0.5 0 1" selectcolor "1 1 1 1" string "_Load" }
Definition in file ui_node_custombutton.c.
#define EXTRADATA | ( | node | ) | UI_EXTRADATA(node, EXTRADATA_TYPE) |
Definition at line 57 of file ui_node_custombutton.c.
#define EXTRADATA_TYPE customButtonExtraData_t |
Definition at line 56 of file ui_node_custombutton.c.
#define EXTRADATACONST | ( | node | ) | UI_EXTRADATACONST(node, EXTRADATA_TYPE) |
Definition at line 58 of file ui_node_custombutton.c.
#define UI_CUSTOMBUTTON_TEX_HEIGHT 64 |
Definition at line 53 of file ui_node_custombutton.c.
Referenced by UI_CustomButtonNodeDraw().
#define UI_CUSTOMBUTTON_TEX_WIDTH 256 |
Definition at line 54 of file ui_node_custombutton.c.
static void UI_CustomButtonNodeDraw | ( | uiNode_t * | node | ) | [static] |
Handles CustomButton draw.
Definition at line 63 of file ui_node_custombutton.c.
References uiNode_s::color, uiNode_s::disabled, EXTRADATA, ICON_STATUS_DISABLED, ICON_STATUS_HOVER, ICON_STATUS_NORMAL, uiNode_s::image, LONGLINES_PRETTYCHOP, uiNode_s::onClick, uiNode_s::padding, pos, R_Color(), uiNode_s::selectedColor, uiNode_s::size, uiNode_s::state, uiNode_s::text, uiNode_s::textalign, UI_CUSTOMBUTTON_TEX_HEIGHT, UI_DrawIconInBox(), UI_DrawNormImageByName(), UI_DrawStringInBox(), UI_GetFontFromNode(), UI_GetNodeAbsPos(), and UI_GetReferenceString().
Referenced by UI_RegisterCustomButtonNode().
void UI_RegisterCustomButtonNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 119 of file ui_node_custombutton.c.
References uiBehaviour_s::draw, uiBehaviour_s::extends, EXTRADATA_TYPE, uiBehaviour_s::extraDataSize, uiBehaviour_s::name, uiBehaviour_s::properties, and UI_CustomButtonNodeDraw().
const value_t properties[] [static] |
{ {"texl", V_POS, UI_EXTRADATA_OFFSETOF(customButtonExtraData_t, texl), MEMBER_SIZEOF(customButtonExtraData_t, texl)}, {NULL, V_NULL, 0, 0} }
Definition at line 113 of file ui_node_custombutton.c.