REVIEWED: Update examples UI styles to latest version, including Latin-1 charset #354

This commit is contained in:
Ray
2024-01-14 17:42:51 +01:00
parent df8ee3e91b
commit 63f0b86a80
12 changed files with 4577 additions and 567 deletions

View File

@ -23,12 +23,19 @@
#include "../../src/raygui.h"
// raygui embedded styles
#include "../styles/style_cyber.h" // raygui style: cyber
#include "../styles/style_jungle.h" // raygui style: jungle
#include "../styles/style_lavanda.h" // raygui style: lavanda
#include "../styles/style_dark.h" // raygui style: dark
#include "../styles/style_bluish.h" // raygui style: bluish
#include "../styles/style_terminal.h" // raygui style: terminal
// NOTE: Included in the same order as selector
#define MAX_GUI_STYLES_AVAILABLE 12 // NOTE: Included light style
#include "../styles/style_jungle.h" // raygui style: jungle
#include "../styles/style_candy.h" // raygui style: candy
#include "../styles/style_lavanda.h" // raygui style: lavanda
#include "../styles/style_cyber.h" // raygui style: cyber
#include "../styles/style_terminal.h" // raygui style: terminal
#include "../styles/style_ashes.h" // raygui style: ashes
#include "../styles/style_bluish.h" // raygui style: bluish
#include "../styles/style_dark.h" // raygui style: dark
#include "../styles/style_cherry.h" // raygui style: cherry
#include "../styles/style_sunny.h" // raygui style: sunny
#include "../styles/style_enefete.h" // raygui style: enefete
#include <string.h> // Required for: strcpy()
@ -39,10 +46,10 @@ int main()
{
// Initialization
//---------------------------------------------------------------------------------------
const int screenWidth = 690;
const int screenHeight = 560;
const int screenWidth = 800;
const int screenHeight = 480;
InitWindow(screenWidth, screenHeight, "raygui - controls test suite");
InitWindow(screenWidth, screenHeight, "raygui - styles selector");
SetExitKey(0);
// Custom GUI font loading
@ -87,22 +94,26 @@ int main()
if (visualStyleActive != prevVisualStyleActive)
{
// Reset to default internal style
// NOTE: Required to unload any previously loaded font texture
GuiLoadStyleDefault();
switch (visualStyleActive)
{
case 0: break; // Default style
case 1: GuiLoadStyleJungle(); break;
case 2: GuiLoadStyleLavanda(); break;
case 3: GuiLoadStyleDark(); break;
case 4: GuiLoadStyleBluish(); break;
case 5: GuiLoadStyleCyber(); break;
case 6: GuiLoadStyleTerminal(); break;
case 2: GuiLoadStyleCandy(); break;
case 3: GuiLoadStyleLavanda(); break;
case 4: GuiLoadStyleCyber(); break;
case 5: GuiLoadStyleTerminal(); break;
case 6: GuiLoadStyleAshes(); break;
case 7: GuiLoadStyleBluish(); break;
case 8: GuiLoadStyleDark(); break;
case 9: GuiLoadStyleCherry(); break;
case 10: GuiLoadStyleSunny(); break;
case 11: GuiLoadStyleEnefete(); break;
default: break;
}
GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
prevVisualStyleActive = visualStyleActive;
}
//----------------------------------------------------------------------------------
@ -115,12 +126,17 @@ int main()
// Visuals options
GuiLabel((Rectangle){ 10, 10, 60, 24 }, "Style:");
GuiComboBox((Rectangle){ 60,10, 120, 24 }, "default;Jungle;Lavanda;Dark;Bluish;Cyber;Terminal", &visualStyleActive);
GuiComboBox((Rectangle){ 60,10, 120, 24 }, "default;Jungle;Candy;Lavanda;Cyber;Terminal;Ashes;Bluish;Dark;Cherry;Sunny;Enefete", &visualStyleActive);
GuiSetIconScale(2);
GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_RIGHT);
GuiButton((Rectangle){ 25, 255, 300, 30 }, GuiIconText(ICON_FILE_SAVE, "Save File"));
GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER);
DrawRectangle(10, 44, GuiGetFont().texture.width, GuiGetFont().texture.height, BLACK);
DrawTexture(GuiGetFont().texture, 10, 44, WHITE);
DrawRectangleLines(10, 44, GuiGetFont().texture.width, GuiGetFont().texture.height,
GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)));
//GuiSetIconScale(2);
//GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_RIGHT);
//GuiButton((Rectangle){ 25, 255, 300, 30 }, GuiIconText(ICON_FILE_SAVE, "Save File"));
//GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER);
//----------------------------------------------------------------------------------
EndDrawing();