From 722a9d1e729aff2eb64f3c064c33d547ea980eb0 Mon Sep 17 00:00:00 2001 From: physick Date: Fri, 31 Jul 2026 18:36:22 +0500 Subject: Buttons GUI start --- src/resources/resources.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/resources/resources.c') diff --git a/src/resources/resources.c b/src/resources/resources.c index e82b6e0..c1b78b5 100644 --- a/src/resources/resources.c +++ b/src/resources/resources.c @@ -5,9 +5,43 @@ Font MainFont; Font MonoFont; +Texture ButtonsAtlas; + +Texture PrepareTexture(char *location) { + Image img = LoadImage(location); + // Applying colorscheme + ImageColorReplace(&img, + (Color) { .r = 0xFF, .g = 0x00, .b = 0x00, .a = 0xFF }, + COLORSCHEME_RED); + ImageColorReplace(&img, + (Color) { .r = 0x00, .g = 0xFF, .b = 0x00, .a = 0xFF }, + COLORSCHEME_GREEN); + ImageColorReplace(&img, + (Color) { .r = 0XFF, .g = 0x7F, .b = 0x00, .a = 0xFF }, + COLORSCHEME_YELLOW); + ImageColorReplace(&img, + (Color) { .r = 0x00, .g = 0x00, .b = 0xFF, .a = 0xFF }, + COLORSCHEME_ORANGE); + ImageColorReplace(&img, + (Color) { .r = 0x00, .g = 0x00, .b = 0x00, .a = 0xFF }, + COLORSCHEME_BROWN); + ImageColorReplace(&img, + (Color) { .r = 0xFF, .g = 0xFF, .b = 0xFF, .a = 0xFF }, + COLORSCHEME_WHITE); + Texture outp = LoadTextureFromImage(img); + UnloadImage(img); + return outp; +} + void LoadResources() { MainFont = LoadFontEx("assets/fonts/coolvetica.ttf", 100, NULL, 0); MonoFont = LoadFontEx("assets/fonts/monofont.ttf", 100, NULL, 0); + + ButtonsAtlas = PrepareTexture("assets/textures/buttons_atlas.png"); +} + +Texture *GetButtonsAtlas() { + return &ButtonsAtlas; } Font *GetMainFont() { return &MainFont; } -- cgit v1.3