add distinct icon-only buffer for internal use (#208)
This commit is contained in:
parent
f534a9a265
commit
013f1a2772
@ -219,7 +219,7 @@ int main()
|
|||||||
if (showTextInputBox)
|
if (showTextInputBox)
|
||||||
{
|
{
|
||||||
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, 0.8f));
|
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, 0.8f));
|
||||||
int result = GuiTextInputBox((Rectangle){ GetScreenWidth()/2 - 120, GetScreenHeight()/2 - 60, 240, 140 }, "Save", GuiIconText(ICON_FILE_SAVE, "Save file as..."), "Introduce a save file name", "Ok;Cancel", textInput, NULL);
|
int result = GuiTextInputBox((Rectangle){ GetScreenWidth()/2 - 120, GetScreenHeight()/2 - 60, 240, 140 }, "Save", GuiIconText(ICON_FILE_SAVE, "Save file as..."), "Ok;Cancel", textInput, 255, NULL);
|
||||||
|
|
||||||
if (result == 1)
|
if (result == 1)
|
||||||
{
|
{
|
||||||
|
13
src/raygui.h
13
src/raygui.h
@ -3546,20 +3546,23 @@ const char *GuiIconText(int iconId, const char *text)
|
|||||||
return NULL;
|
return NULL;
|
||||||
#else
|
#else
|
||||||
static char buffer[1024] = { 0 };
|
static char buffer[1024] = { 0 };
|
||||||
memset(buffer, 0, 1024);
|
static char iconBuffer[6] = {0};
|
||||||
|
|
||||||
sprintf(buffer, "#%03i#", iconId);
|
|
||||||
|
|
||||||
if (text != NULL)
|
if (text != NULL)
|
||||||
{
|
{
|
||||||
|
memset(buffer, 0, 1024);
|
||||||
|
sprintf(buffer, "#%03i#", iconId);
|
||||||
for (int i = 5; i < 1024; i++)
|
for (int i = 5; i < 1024; i++)
|
||||||
{
|
{
|
||||||
buffer[i] = text[i - 5];
|
buffer[i] = text[i - 5];
|
||||||
if (text[i - 5] == '\0') break;
|
if (text[i - 5] == '\0') break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sprintf(iconBuffer, "#%03i#", iconId&0x1ff);
|
||||||
|
return iconBuffer;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user