68 const char* suffix[
SPRITE_STATUS_MAX] = {
"",
"_hovered",
"_disabled",
"_clicked"};
73 Q_strncpyz(basePicNameBuf, name,
sizeof(basePicNameBuf));
85 Com_sprintf(picNameBuf,
sizeof(picNameBuf),
"%s%s", basePicNameBuf, suffix[i]);
135 Com_Error(
ERR_FATAL,
"UI_AllocStaticSprite: \"%s\" sprite already allocated. Check your scripts.", name);
202 }
else if (sprite->
pack64) {
207 texX = sprite->
pos[status][0];
208 texY = sprite->
pos[status][1];
209 image = sprite->
image[status];
211 if (texX == 0 && texY == 0) {
240 }
else if (sprite->
border != 0) {
245 posX += (sizeX - sprite->
size[0]) / 2;
246 posY += (sizeY - sprite->
size[1]) / 2;
248 texX + sprite->
size[0], texY + sprite->
size[1], texX, texY, image);
valueTypes_t
possible values for parsing functions
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
void UI_DrawSpriteInBox(bool flip, const uiSprite_t *sprite, uiSpriteStatus_t status, int posX, int posY, int sizeX, int sizeY)
void UI_DrawPanel(const vec2_t pos, const vec2_t size, const char *texture, int texX, int texY, const int panelDef[7])
draw a panel from a texture as we can see on the image
void R_Color(const vec4_t rgba)
Change the color to given value.
Internal data use by the UI package.
void Com_Error(int code, const char *fmt,...)
uiSprite_t * UI_AllocStaticSprite(const char *name)
Allocate an sprite to the UI static memory.
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
const image_t * UI_DrawNormImageByName(bool flip, float x, float y, float w, float h, float sh, float th, float sl, float tl, const char *name)
Draws an image or parts of it.
uiSprite_t sprites[UI_MAX_SPRITES]
const struct image_s * UI_LoadImage(const char *name)
Searches for an image in the image array.
static const int tile_template_17_1_3[]
char * image[SPRITE_STATUS_MAX]
static uiSprite_t * UI_AutoGenerateSprite(const char *name)
Search a file name inside pics/ according to the sprite name If it exists, generate a "single" sprite...
static bool UI_SpriteExists(const char *name)
Check if an sprite name exists.
const value_t ui_spriteProperties[]
#define Vector2FromInt(x, y)
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
vec4_t color[SPRITE_STATUS_MAX]
#define MEMBER_SIZEOF(TYPE, MEMBER)
static const int tile_template_25_1_3[]
static const int tile_template_popup[]
vec2_t pos[SPRITE_STATUS_MAX]
void UI_DrawBorderedPanel(const vec2_t pos, const vec2_t size, const char *texture, int texX, int texY, int texW, int texH, int border)
draw a panel from a texture as we can see on the image
uiSprite_t * UI_GetSpriteByName(const char *name)
Return an sprite by is name.
char * UI_AllocStaticString(const char *string, int size)
Allocate a string into the UI static memory.