Вопрос Не рендерит полностью название кнопки ImGui

Статус
В этой теме нельзя размещать новые ответы.
B.O.M.J
Эксперт
Статус
Оффлайн
Регистрация
19 Май 2017
Сообщения
2,403
Реакции[?]
897
Поинты[?]
3K
Собственно шапка
1643258536687.png
Вот допустим код кнопки удаления кфг
C++:
    if (ImGui::CustomButton(_S("Delete Config"), ImVec2(iChildDoubleSizeX - 20, 30)))
    {
        if (g_Config->files.empty())
            return;

        g_Config->remove(g_Config->files.at(selected_config));

        g_Config->config_files();
        g_LogManager->PushLog(_S("Config Removed"), _S("A"));
    }
iChildDoubleSizeX - 376.5
 
Забаненный
Статус
Оффлайн
Регистрация
13 Июн 2020
Сообщения
227
Реакции[?]
57
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Собственно шапка
Посмотреть вложение 189720
Вот допустим код кнопки удаления кфг
C++:
    if (ImGui::CustomButton(_S("Delete Config"), ImVec2(iChildDoubleSizeX - 20, 30)))
    {
        if (g_Config->files.empty())
            return;

        g_Config->remove(g_Config->files.at(selected_config));

        g_Config->config_files();
        g_LogManager->PushLog(_S("Config Removed"), _S("A"));
    }
iChildDoubleSizeX - 376.5
покажи сам кастом бут
 
B.O.M.J
Эксперт
Статус
Оффлайн
Регистрация
19 Май 2017
Сообщения
2,403
Реакции[?]
897
Поинты[?]
3K
C++:
bool ImGui::CustomButton(const char* txt, const ImVec2& size)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    ImGuiContext& g = *GImGui;
    const ImGuiStyle& style = g.Style;

    // Default to using texture ID as ID. User can still push string/integer prefixes.
    // We could hash the size/uv to create a unique ID but that would prevent the user from animating UV.
    const ImGuiID id = window->GetID(txt);
    const ImVec2 padding = style.FramePadding;
    const ImRect bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size);
    ItemSize(bb);
    if (!ItemAdd(bb, id))
        return false;

    bool hovered, held;
    bool pressed = ButtonBehavior(bb, id, &hovered, &held);

    window->DrawList->AddRectFilled(bb.Min, bb.Max, ImColor(15, 17, 19, (int)(g.Style.Alpha * 255)));
    window->DrawList->AddRect(bb.Min, bb.Max, ImColor(10 / 255.f, 12 / 255.f, 14 / 255.f, g.Style.Alpha));
    window->DrawList->AddRect(bb.Min + ImVec2(1, 1), bb.Max - ImVec2(1, 1), ImColor(45 / 255.f, 47 / 255.f, 54 / 255.f, g.Style.Alpha));


    std::string s_txt = ClampName(txt);
    auto tSize = CalcTextSize(s_txt.data());
    window->DrawList->AddText(ImVec2(bb.Min.x + size.x / 2 - tSize.x / 2, bb.Min.y + size.y / 2 - tSize.y / 2), GetColorU32(ImGuiCol_Text), s_txt.data());

    return pressed;
}
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу