Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty button instead of custom symbol #4

Open
SinixND opened this issue Nov 8, 2023 · 0 comments
Open

Empty button instead of custom symbol #4

SinixND opened this issue Nov 8, 2023 · 0 comments

Comments

@SinixND
Copy link

SinixND commented Nov 8, 2023

Do I have to include #define RAYGUI_CUSTOM_ICONS in every file where I include raygui.h, no matter if custom icons are used in it or not?

because I had an issue where - if I left it out of main.cpp - it would show an empty button (in my case) instead of the custom symbol. In my case main.cpp is the "root" file that includes different UI screens via the respective files (eg. sndMenu.cpp), therefore main.cpp doesn't use any custom symbols (or even plain text) at all.

Structure to render my menu screen (whose declaration-header is sndScenes.h) is like this:
`
//main.cpp
//------------------------------
#include <raylib.h>

#define RAYGUI_IMPLEMENTATION // only define once
#define RAYGUI_CUSTOM_ICONS // left this line out before, adding it solved the issue
#include "../resources/sndIcons.rgi.h" // left this line out before, adding it solved the issue
#include <raygui.h>
#include "sndScenes.h"

// no custom symbol used in here
//------------------------------

//sndMenu.cpp
//------------------------------
#define RAYGUI_CUSTOM_ICONS // Custom icons set required
#include "../resources/sndIcons.rgi.h"
#include <raygui.h>

#include "sndScenes.h"

GuiButton((Rectangle)(left, right, width, height), GuiIconText(ICON_DARK_MODE, ""))
//------------------------------
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant