2
3
4
5
9#include "Core/Library/FileLibrary.h"
10#include "Render/FrameInfo.h"
11#include "World/World/World.h"
12#include "Slate/SlateImage.h"
13#include "Render/Renderer/SpecificRenderer/SlateRenderer.h"
17#include <imgui_internal.h>
18#include <imgui_widgets.cpp>
19#include <backends/imgui_impl_vulkan.cpp>
28
29
30 ImGui::StyleColorsDark();
33
34
35 ImGuiStyle& style = ImGui::GetStyle();
36 style.WindowRounding = 0.0f;
37 style.WindowBorderSize = 0.0f;
38 style.WindowPadding = ImVec2(3.0f, 3.0f);
39 style.ColorButtonPosition = ImGuiDir_Left;
40 style.FrameRounding = 4.0f;
41 style.FrameBorderSize = 0.0f;
42 style.FramePadding = ImVec2(2.0f, 2.0f);
43 style.GrabRounding = 4.0f;
44 style.IndentSpacing = 12.0f;
45 style.ItemSpacing = ImVec2(2.0f, 2.0f);
46 style.ScrollbarSize = 4.0f;
47 style.SeparatorTextAlign = ImVec2(0.0f, 0.5f);
48 style.SeparatorTextPadding = ImVec2(0.0f, 0.0f);
49 style.SeparatorTextBorderSize = 1.0f;
50 style.GrabMinSize = 2.0f;
51 style.Colors[ImGuiCol_WindowBg] = ImVec4(0.27f, 0.27f, 0.27f, 1.0f);
52 style.Colors[ImGuiCol_MenuBarBg] = style.Colors[ImGuiCol_WindowBg];
53 style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.2f, 0.2f, 0.2f, 1.0f);
54 style.Colors[ImGuiCol_PopupBg] = ImVec4(0.135f, 0.135f, 0.135f, 1.0f);
55 style.Colors[ImGuiCol_Border] = ImVec4(0.141f, 0.129f, 0.121f, 1.0f);
56 style.Colors[ImGuiCol_FrameBg] = ImVec4(0.125f, 0.129f, 0.137f, 1.0f);
57 style.Colors[ImGuiCol_PopupBg] = ImVec4(0.22f, 0.231f, 0.239f, 1.0f);
58 style.Colors[ImGuiCol_TabUnfocused] = style.Colors[ImGuiCol_WindowBg];
59 style.Colors[ImGuiCol_TabActive] = style.Colors[ImGuiCol_WindowBg];
60 style.Colors[ImGuiCol_TabUnfocusedActive] = style.Colors[ImGuiCol_WindowBg];
61 style.Colors[ImGuiCol_TabHovered] = ImVec4(0.2f, 0.2f, 0.2f, 1.0f);
64
65
66 style.Colors[ImGuiCol_Button] = style.Colors[ImGuiCol_WindowBg];
67 style.Colors[ImGuiCol_ButtonActive] = style.Colors[ImGuiCol_FrameBg];
68 style.Colors[ImGuiCol_ButtonHovered]= ImVec4(0.3f, 0.3f, 0.3f, 1.0f);
71
72
73 constexpr ImVec4 normal_color(0.465f, 0.465f, 0.525f, 1.0f);
74 std::vector<ImGuiCol> to_change_nrm;
75 to_change_nrm.push_back(ImGuiCol_Header);
76 to_change_nrm.push_back(ImGuiCol_SliderGrab);
77 to_change_nrm.push_back(ImGuiCol_CheckMark);
78 to_change_nrm.push_back(ImGuiCol_ResizeGrip);
79 to_change_nrm.push_back(ImGuiCol_TextSelectedBg);
80 to_change_nrm.push_back(ImGuiCol_Separator);
81 to_change_nrm.push_back(ImGuiCol_FrameBgActive);
82 for (
auto c : to_change_nrm)
84 style.Colors[c] = normal_color;
88
89
90 constexpr ImVec4 active_color(0.365f, 0.365f, 0.425f, 1.0f);
91 std::vector<ImGuiCol> to_change_act;
92 to_change_act.push_back(ImGuiCol_HeaderActive);
93 to_change_act.push_back(ImGuiCol_SliderGrabActive);
94 to_change_act.push_back(ImGuiCol_ResizeGripActive);
95 to_change_act.push_back(ImGuiCol_SeparatorActive);
96 for (
auto c : to_change_act)
98 style.Colors[c] = active_color;
102
103
104 constexpr ImVec4 hovered_color(0.565f, 0.565f, 0.625f, 1.0f);
105 std::vector<ImGuiCol> to_change_hover;
106 to_change_hover.push_back(ImGuiCol_HeaderHovered);
107 to_change_hover.push_back(ImGuiCol_FrameBgHovered);
108 to_change_hover.push_back(ImGuiCol_ResizeGripHovered);
109 to_change_hover.push_back(ImGuiCol_SeparatorHovered);
110 for (
auto c : to_change_hover)
112 style.Colors[c] = hovered_color;
115 style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.465f, 0.465f, 0.465f, 1.0f);
116 style.Colors[ImGuiCol_TitleBg] = ImVec4(0.125f, 0.125f, 0.125f, 1.0f);
117 style.Colors[ImGuiCol_Tab] = ImVec4(0.05f, 0.05f, 0.05f, 0.5f);
118 style.Colors[ImGuiCol_TabHovered] = ImVec4(0.465f, 0.495f, 0.525f, 1.0f);
119 style.Colors[ImGuiCol_TabActive] = ImVec4(0.282f, 0.290f, 0.302f, 1.0f);
120 style.Colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.465f, 0.465f, 0.465f, 0.350f);
124 ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_PickerHueWheel);
131 ImGuiIO& io = ImGui::GetIO();
135
136
137 ImFont* font =
nullptr;
142 const std::string p = R"(C:/Windows/Fonts/consola.ttf)";
145 font = io.Fonts->AddFontFromFileTTF(p.c_str(), 12.0f * high_dpi_scale);
151 const char* vk_path = getenv(
"VK_SDK_PATH");
154 const std::string p = std::string(vk_path) + R"(/Samples/Layer-Samples/data/FreeSans.ttf)";
155 if (FileLibrary::FileLibrary_Exists(p.c_str()))
156 font = io.Fonts->AddFontFromFileTTF(p.c_str(), 16.0f * high_dpi_scale);
160 const std::string p = R"(C:/Windows/Fonts/segoeui.ttf)";
161 if (FileLibrary::FileLibrary_Exists(p.c_str()))
162 font = io.Fonts->AddFontFromFileTTF(p.c_str(), 16.0f * high_dpi_scale);
168 ImFontConfig font_config = ImFontConfig();
169 font_config.SizePixels = 13.0f * ((fontmode == FONT_FIXED) ? 1 : high_dpi_scale);
170 io.Fonts->AddFontDefault(&font_config);
173 float iconFontSize = 15.0f * high_dpi_scale;
176 static constexpr ImWchar icons_ranges[] = { ICON_MIN_MD, ICON_MAX_16_MD, 0 };
177 ImFontConfig icons_config;
178 icons_config.MergeMode =
true;
179 icons_config.PixelSnapH =
true;
180 icons_config.GlyphMinAdvanceX = iconFontSize;
181 icons_config.GlyphOffset.y = 3.0f;
183 std::stringstream ss;
184 ss << SPICES_ENGINE_ASSETS_PATH <<
"Fonts/" << FONT_ICON_FILE_NAME_MD;
187 io.Fonts->AddFontFromFileTTF(ss.str().c_str(), iconFontSize, &icons_config, icons_ranges);
196 ImGuiID dockspaceID = ImGui::GetID(
"DockSpace");
199 const ImGuiViewport* viewport = ImGui::GetMainViewport();
200 ImGui::SetNextWindowPos(viewport->WorkPos);
201 ImGui::SetNextWindowSize(viewport->WorkSize);
202 ImGui::SetNextWindowViewport(viewport->ID);
204 ImGuiWindowFlags host_window_flags = 0;
205 host_window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize;
206 host_window_flags |= ImGuiWindowFlags_NoMove;
207 host_window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus;
208 host_window_flags |= ImGuiWindowFlags_NoBackground;
211 ImFormatString(label, IM_ARRAYSIZE(label),
"DockSpaceViewport_%08X", viewport->ID);
212 ImGui::Begin(label, NULL, host_window_flags);
217 ImGuiDockNodeFlags dockspaceFlags =
218 ImGuiDockNodeFlags_PassthruCentralNode;
223 if (!ImGui::DockBuilderGetNode(dockspaceID))
226 ImGui::DockBuilderRemoveNode(dockspaceID);
227 ImGui::DockBuilderAddNode(dockspaceID, ImGuiDockNodeFlags_DockSpace);
229 ImGuiID dock_main_id = dockspaceID;
232 ImGuiID id_left = ImGui::DockBuilderSplitNode(dock_main_id, ImGuiDir_Left, 0.2f,
nullptr, &dock_main_id);
233 ImGui::DockBuilderDockWindow(side == Side::Left ?
"Docking Space" :
"Dock_left", id_left);
235 ImGuiID id_right = ImGui::DockBuilderSplitNode(dock_main_id, ImGuiDir_Right, 0.2f,
nullptr, &dock_main_id);
236 ImGui::DockBuilderDockWindow(side == Side::Right ?
"Docking Space" :
"Dock_right", id_right);
238 ImGuiID id_up = ImGui::DockBuilderSplitNode(dock_main_id, ImGuiDir_Up, 0.2f,
nullptr, &dock_main_id);
239 ImGui::DockBuilderDockWindow(side == Side::Up ?
"Docking Space" :
"Dock_up", id_up);
241 ImGuiID id_down = ImGui::DockBuilderSplitNode(dock_main_id, ImGuiDir_Down, 0.2f,
nullptr, &dock_main_id);
242 ImGui::DockBuilderDockWindow(side == Side::Down ?
"Docking Space" :
"Dock_down", id_down);
244 ImGui::DockBuilderDockWindow(side == Side::Scene ?
"Docking Space" :
"Scene", dock_main_id);
246 ImGui::DockBuilderFinish(dock_main_id);
250 ImVec4 col = ImGui::GetStyleColorVec4(ImGuiCol_WindowBg);
251 ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(col.x, col.y, col.z, alpha));
253 ImGui::DockSpace(dockspaceID, ImVec2(0.0f, 0.0f), dockspaceFlags);
254 ImGui::PopStyleColor();
260 float x = ImGui::GetFont()->FontSize * ImGui::GetIO().FontGlobalScale + ImGui::GetStyle().FramePadding.y * 2.0f;
266 bool IsReset =
false;
270 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImGui::GetStyle().Colors[ImGuiCol_Button]);
271 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.31f, 0.49f, 0.62f, 1.0f));
272 IsReset = ImGui::Button(ICON_MD_SQUARE, ImGuiH::GetLineItemSize());
273 ImGui::PopStyleColor(2);
277 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImGui::GetStyle().Colors[ImGuiCol_Button]);
278 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::GetStyle().Colors[ImGuiCol_Button]);
279 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.4f, 0.4f, 0.4f, 1.0f));
281 ImGui::SetWindowFontScale(0.65f);
282 ImGui::Button(ICON_MD_STOP, ImGuiH::GetLineItemSize());
283 ImGui::SetWindowFontScale(1.0f);
284 ImGui::PopStyleColor(3);
292 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.6f, 0.6f, 0.6f, 1.0f));
293 if (ImGui::Button(*isChecked ? ICON_MD_CHECK_BOX : ICON_MD_SQUARE, ImGuiH::GetLineItemSize()))
295 *isChecked = !*isChecked;
297 ImGui::PopStyleColor();
302 ImGui::SetWindowFontScale(0.5f);
303 ImGui::SeparatorText(
"##");
304 ImGui::SetWindowFontScale(1.0f);
311 ImGuiWindow* window = ImGui::GetCurrentWindow();
312 const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
314 ImDrawList* draw_list = ImGui::GetWindowDrawList();
315 draw_list->PushTextureID(context->GetTextureID());
316 draw_list->PrimReserve(6, 4);
317 draw_list->PrimRectUV(bb.Min, bb.Max, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), ImGui::GetColorU32(ImVec4(1.0f, 1.0f, 1.0f, 1.0f)));
318 draw_list->AddCallback([](
const ImDrawList* drawList,
const ImDrawCmd* cmd,
const int global_idx_offset,
const int global_vtx_offset) {
320 ImGui_ImplVulkan_RenderState* render_state = (ImGui_ImplVulkan_RenderState*)ImGui::GetPlatformIO().Renderer_RenderState;
321 auto set =
reinterpret_cast<VkDescriptorSet>(cmd->GetTexID());
322 auto pipeline =
static_cast<VulkanPipeline*>(cmd->UserCallbackData);
324 ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();
325 vkCmdBindDescriptorSets(render_state->CommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, render_state->PipelineLayout, 0, 1, &set, 0,
nullptr);
329 vkCmdDrawIndexed(render_state->CommandBuffer, cmd->ElemCount, 1, cmd->IdxOffset + global_idx_offset, cmd->VtxOffset + global_vtx_offset, 0);
331 }, SlateRenderer::GetPipeline(context->GetMaterial()->GetName()).get());
332 draw_list->PopTextureID();
333 draw_list->AddCallback(ImDrawCallback_ResetRenderState,
nullptr);
337 const std::string& itemName ,
339 std::function<
void()> nameFunc ,
340 std::function<
void()> valFunc
345 ImGui::PushID(itemName.c_str());
346 ImGui::Columns(2, 0,
false);
348 ImGui::SetColumnWidth(0, columeWidth);
356 ImGui::Text(itemName.c_str());
368 const std::string& treeName ,
369 std::function<
void()> optionFunc ,
370 std::function<
void()> treeFunc
375 constexpr ImGuiTreeNodeFlags treeNodeFlags =
376 ImGuiTreeNodeFlags_DefaultOpen |
377 ImGuiTreeNodeFlags_AllowItemOverlap |
378 ImGuiTreeNodeFlags_Framed |
379 ImGuiTreeNodeFlags_FramePadding ;
381 ImGui::PushStyleColor(ImGuiCol_Header , ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
382 ImGui::PushStyleColor(ImGuiCol_HeaderHovered , ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
383 ImGui::PushStyleColor(ImGuiCol_HeaderActive , ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
384 ImGui::PushStyleColor(ImGuiCol_WindowBg , ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
386 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding , ImVec2(2.0f, 6.0f));
387 const bool open = ImGui::TreeNodeEx(treeName.c_str(), treeNodeFlags, treeName.c_str());
388 ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGuiH::GetLineItemSize().x);
389 ImGui::PushStyleColor(ImGuiCol_Button , ImVec4(0.16f, 0.16f, 0.16f, 1.0f));
390 ImGui::PushStyleColor(ImGuiCol_ButtonHovered , ImVec4(0.608f, 0.608f, 0.608f, 1.0f));
391 ImGui::PushStyleColor(ImGuiCol_ButtonActive , ImVec4(0.396f, 0.439f, 0.168f, 1.0f));
392 if (ImGui::Button(ICON_MD_FILTER_VINTAGE, ImGuiH::GetLineItemSize()))
394 ImGui::OpenPopup(treeName.c_str());
396 ImGui::PopStyleColor(3);
397 ImGui::PopStyleVar();
398 if (ImGui::BeginPopup(treeName.c_str()))
415 ImGui::PopStyleColor(4);
419 const std::string& treeName,
420 std::function<
void()> progressFunc,
421 std::function<
void()> treeFunc
426 constexpr ImGuiTreeNodeFlags treeNodeFlags =
427 ImGuiTreeNodeFlags_DefaultOpen |
428 ImGuiTreeNodeFlags_AllowItemOverlap |
429 ImGuiTreeNodeFlags_Framed |
430 ImGuiTreeNodeFlags_Bullet |
431 ImGuiTreeNodeFlags_FramePadding ;
433 ImGui::PushStyleColor(ImGuiCol_Header , ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
434 ImGui::PushStyleColor(ImGuiCol_HeaderHovered , ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
435 ImGui::PushStyleColor(ImGuiCol_HeaderActive , ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
436 ImGui::PushStyleColor(ImGuiCol_WindowBg , ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
438 const bool open = ImGui::TreeNodeEx(treeName.c_str(), treeNodeFlags, treeName.c_str());
442 ImGui::SameLine(ImGui::GetContentRegionAvail().x * 0.3f);
455 ImGui::PopStyleColor(4);
459 const std::string& name ,
461 const std::shared_ptr<
Material>& material
466 ImGuiH::DrawTreeTitle(name,
nullptr, [&]() {
468 material->GetConstantParams().for_each([&](
const std::string& k, ConstantParams& v){
469 ImGuiH::DrawPropertyItem(k, width,
nullptr, [&](){
470 if(v.value.paramType ==
"float")
472 if (ImGuiH::DrawMaterialConstParams<
float>(material, ImGuiDataType_Float, 1,
"%.3f", v))
474 FrameInfo::Get().m_World->Mark(World::NeedUpdateTLAS | World::FrushStableFrame);
477 else if(v.value.paramType ==
"float2")
479 if (ImGuiH::DrawMaterialConstParams<glm::vec2>(material, ImGuiDataType_Float, 2,
"%.3f", v))
481 FrameInfo::Get().m_World->Mark(World::NeedUpdateTLAS | World::FrushStableFrame);
484 else if(v.value.paramType ==
"float3")
486 if (ImGuiH::DrawMaterialConstParams<glm::vec3>(material, ImGuiDataType_Float, 3,
"%.3f", v))
488 FrameInfo::Get().m_World->Mark(World::NeedUpdateTLAS | World::FrushStableFrame);
491 else if(v.value.paramType ==
"float4")
493 if (ImGuiH::DrawMaterialConstParams<glm::vec4>(material, ImGuiDataType_Float, 4,
"%.3f", v))
495 FrameInfo::Get().m_World->Mark(World::NeedUpdateTLAS | World::FrushStableFrame);
498 else if(v.value.paramType ==
"int")
500 if (ImGuiH::DrawMaterialConstParams<
int>(material, ImGuiDataType_S32, 1,
"%d", v))
502 FrameInfo::Get().m_World->Mark(World::NeedUpdateTLAS | World::FrushStableFrame);
505 else if (v.value.paramType ==
"bool")
507 bool f = std::any_cast<
bool>(v.value.paramValue);
509 bool df = std::any_cast<
bool>(v.defaultValue.paramValue);
511 const float seperatorWidthS = ImGuiH::GetLineItemSize().x - 3.0f * ImGui::GetStyle().IndentSpacing;
512 ImGuiH::Checkbox(&nf);
515 v.value.paramValue = nf;
516 material->UpdateMaterial();
519 ImGui::PushItemWidth(100.0f);
520 ImGui::SeparatorText(
"##");
521 ImGui::PopItemWidth();
522 ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x);
523 if (ImGuiH::DrawResetIcon(f != df))
525 v.value.paramValue = df;
526 material->UpdateMaterial();
537 ImGuiDataType data_type ,
544 ImGuiSliderFlags flags
547 using namespace ImGui;
549 ImGuiWindow* window = GetCurrentWindow();
550 if (window->SkipItems)
553 ImGuiContext& g = *GImGui;
554 bool value_changed =
false;
557 PushMultiItemsWidths(components, CalcItemWidth());
558 size_t type_size = GDataTypeInfo[data_type].Size;
559 for (
int i = 0; i < components; i++)
563 SameLine(0, g.Style.ItemInnerSpacing.x);
564 const void* cp_min = (
float*)p_min + i;
565 const void* cp_mmx = (
float*)p_max + i;
566 value_changed |= DragScalar(
"", data_type, p_data, v_speed, cp_min, cp_mmx, format, flags);
569 p_data = (
void*)((
char*)p_data + type_size);
573 const char* label_end = FindRenderedTextEnd(label);
574 if (label != label_end)
576 SameLine(0, g.Style.ItemInnerSpacing.x);
577 TextEx(label, label_end);
581 return value_changed;
590 static float cached_dpi_scale = -1.0f;
592 if (cached_dpi_scale < 0.0f)
596 cached_dpi_scale = 1.0f;
598 GLFWmonitor* monitor = glfwGetPrimaryMonitor();
599 if (monitor !=
nullptr)
602 glfwGetMonitorContentScale(monitor, &cached_dpi_scale, &y_scale);
608 const char* dpi_env = getenv(
"NVPRO_DPI_SCALE");
611 const float parsed_dpi_env = strtof(dpi_env,
nullptr);
612 if (parsed_dpi_env != 0.0f)
614 cached_dpi_scale *= parsed_dpi_env;
618 cached_dpi_scale = (cached_dpi_scale > 0.0f ? cached_dpi_scale : 1.0f);
621 return cached_dpi_scale;
629 ImGuiWindow* window = GetCurrentWindow();
631 ImGuiContext& g = *GImGui;
632 const ImGuiStyle& style = g.Style;
633 const ImGuiID id = window->GetID(label);
634 const ImVec2 label_size = CalcTextSize(label, NULL,
true);
636 ImVec2 pos = window->DC.CursorPos;
637 ImVec2 size = CalcItemSize(size_arg, label_size.x + style.FramePadding.x * 2.0f, label_size.y + style.FramePadding.y * 2.0f);
639 const ImVec2 pos2 = ImVec2((pos.x + size.x), (pos.y + size.y));
640 const ImRect bb(pos, pos2);
642 ItemSize(size, style.FramePadding.y);
644 const ImVec2 pos_min = ImVec2((bb.Min.x + style.FramePadding.x), (bb.Min.y + style.FramePadding.y));
645 const ImVec2 pos_max = ImVec2((bb.Max.x - style.FramePadding.x), (bb.Max.y - style.FramePadding.y));
647 RenderTextClipped(pos_min, pos_max, label, NULL, &label_size, style.ButtonTextAlign, &bb);
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
static bool FileLibrary_Exists(const char *path)
Determine whether the given string is existing a file.
File Static Function Library.
static void SetFonts(FontMode fontmode=FontMode::FONT_PROPORTIONAL_SCALED)
Looking for TTF fonts, first on the VULKAN SDK, then Windows default fonts.
static void SetStyle()
Setting common style across samples.
static void MainMenuTitleSeparator()
Draw main menu titile separator.
static bool DrawResetIcon(const bool &isMove)
Draw Reset Icon.
static void DrawMaterial(const std::string &name, float width, const std::shared_ptr< Material > &material)
Draw a Material.
static void MainDockSpace(Side side=Side::Scene, float alpha=1.0f)
Begin a docking space.
static void Checkbox(bool *isChecked)
ImGuiHelper Style Checkbox.
static float GetDPIScale()
Get GLFW DPI Scale.
The ImGuiH Class. This class defines helper function for slate render.
Material Class. This class contains a branch of parameter and shader, also descriptor.
Slate image draw context.
void CenteredText(const char *label, const ImVec2 &size_arg)
Draw a center text.
Side
Where the slate's initialized pos.
@ FONT_PROPORTIONAL_SCALED