如何更改ImGui中按钮的文本颜色? (未回答)

问题描述 投票:0回答:2

我正在寻找一种方法来更改“名称”按钮上显示的文本的颜色,但是我对此一无所知。我想使其绿色,表示赞赏或帮助:D

// Name
            ImGui::InputText("Name", selected_entry.name, 32);

            // Item to change
            ImGui::Combo("Item", &selected_entry.definition_vector_index, [](void* data, int idx, const char** out_text)
            {
                *out_text = game_data::weapon_names[idx].name;
                return true;
            }, nullptr, game_data::weapon_names.size(), 5);

            // Enabled
            ImGui::Checkbox("Enabled", &selected_entry.enabled);
c++ button imgui
2个回答
0
投票

我认为它完全依赖于编译器,没有c ++。请尝试在ide的视图选项卡中对其进行检查。


0
投票

使用向导为按钮添加变量(例如button):

CMFCButton  button;

使用以下方法更改面部和文字颜色:

button.SetFaceColor(RGB(255,0,0),true);
button.SetTextColor(RGB(0,0,255));
© www.soinside.com 2019 - 2024. All rights reserved.