mirror of
https://github.com/raysan5/raygui.git
synced 2025-12-25 10:22:33 -05:00
Changed label text and GuiLoadStyle()
This commit is contained in:
21
src/raygui.h
21
src/raygui.h
@ -855,8 +855,8 @@ RAYGUIDEF void GuiLabel(Rectangle bounds, const char *text)
|
|||||||
{
|
{
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
case FOCUSED:
|
case FOCUSED:
|
||||||
case PRESSED: DrawText(text, bounds.x, bounds.y, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_NORMAL])); break;
|
case PRESSED: DrawText(text, bounds.x, bounds.y + bounds.height/2 - textHeight/2, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_NORMAL])); break;
|
||||||
case DISABLED: DrawText(text, bounds.x, bounds.y, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_DISABLED])); break;
|
case DISABLED: DrawText(text, bounds.x, bounds.y + bounds.height/2 - textHeight/2, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_DISABLED])); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
@ -1153,10 +1153,10 @@ RAYGUIDEF bool GuiLabelButton(Rectangle bounds, const char *text)
|
|||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case NORMAL: DrawText(text, bounds.x, bounds.y, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_NORMAL])); break;
|
case NORMAL: DrawText(text, bounds.x, bounds.y + bounds.height/2 - textHeight/2, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_NORMAL])); break;
|
||||||
case FOCUSED: DrawText(text, bounds.x, bounds.y, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_FOCUSED])); break;
|
case FOCUSED: DrawText(text, bounds.x, bounds.y + bounds.height/2 - textHeight/2, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_FOCUSED])); break;
|
||||||
case PRESSED: DrawText(text, bounds.x, bounds.y, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_PRESSED])); break;
|
case PRESSED: DrawText(text, bounds.x, bounds.y + bounds.height/2 - textHeight/2, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_PRESSED])); break;
|
||||||
case DISABLED: DrawText(text, bounds.x, bounds.y, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_DISABLED])); break;
|
case DISABLED: DrawText(text, bounds.x, bounds.y + bounds.height/2 - textHeight/2, style[DEFAULT_TEXT_SIZE], GetColor(style[LABEL_TEXT_COLOR_DISABLED])); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
@ -2693,13 +2693,16 @@ RAYGUIDEF void GuiLoadStyle(const char *fileName)
|
|||||||
char signature[5] = "";
|
char signature[5] = "";
|
||||||
short version = 0;
|
short version = 0;
|
||||||
short numProperties = 0;
|
short numProperties = 0;
|
||||||
int reserved = 0;
|
short changedProperties = 0;
|
||||||
|
short reserved = 0;
|
||||||
|
int editionTime = 0;
|
||||||
|
|
||||||
fread(signature, 1, 4, rgsFile);
|
fread(signature, 1, 4, rgsFile);
|
||||||
fread(&version, 1, sizeof(short), rgsFile);
|
fread(&version, 1, sizeof(short), rgsFile);
|
||||||
|
fread(&reserved, 1, sizeof(short), rgsFile);
|
||||||
fread(&numProperties, 1, sizeof(short), rgsFile);
|
fread(&numProperties, 1, sizeof(short), rgsFile);
|
||||||
fread(&reserved, 1, sizeof(int), rgsFile);
|
fread(&changedProperties, 1, sizeof(short), rgsFile);
|
||||||
|
|
||||||
if ((signature[0] == 'R') &&
|
if ((signature[0] == 'R') &&
|
||||||
(signature[1] == 'G') &&
|
(signature[1] == 'G') &&
|
||||||
(signature[2] == 'S') &&
|
(signature[2] == 'S') &&
|
||||||
|
|||||||
Reference in New Issue
Block a user