Skip to content

Empty button instead of custom symbol #4

@SinixND

Description

@SinixND

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, ""))
//------------------------------
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions