ImGui-imgui实例解析之ShowStyleEditor-Fonts
ImGui-imgui实例解析之ShowStyleEditor-Fonts
获得字体:
ImFontAtlas* atlas = io.Fonts;
显示字体集:
ImGui::ShowFontAtlas(atlas);
艹,这里面代码太多了,你们自己看吧。呵呵。
for (int i = 0; i < atlas->Fonts.Size; i++)
{
ImFont* font = atlas->Fonts[i];
PushID(font);
DebugNodeFont(font);
PopID();
}
增加图片:
Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), tint_col, border_col);
设置窗口比例:
if (ImGui::DragFloat("window scale", &window_scale, 0.005f, MIN_SCALE, MAX_SCALE, "%.2f", ImGuiSliderFlags_AlwaysClamp)) // Scale only this window
ImGui::SetWindowFontScale(window_scale);
设置全局比例:
ImGui::DragFloat("global scale", &io.FontGlobalScale, 0.005f, MIN_SCALE, MAX_SCALE, "%.2f", ImGuiSliderFlags_AlwaysClamp); // Scale everything
欢迎关注我,一起进步!扫描下方二维码即可加我