mirror of
https://github.com/orange-cpp/omath.git
synced 2026-08-07 21:42:05 +00:00
added blur
This commit is contained in:
@@ -66,7 +66,7 @@ namespace imgui_desktop::gui
|
||||
ImGui::Begin("Controls", &m_opened,
|
||||
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse);
|
||||
ImGui::PushItemWidth(160.f);
|
||||
const auto draw_glow_controls = [](const char* label, GlowSettings& settings)
|
||||
const auto draw_glow_controls = [](const char* label, GlowSettings& settings, const float max_radius = 30.f)
|
||||
{
|
||||
ImGui::PushID(label);
|
||||
ImGui::TextUnformatted(label);
|
||||
@@ -74,7 +74,7 @@ namespace imgui_desktop::gui
|
||||
if (settings.enabled)
|
||||
{
|
||||
ImGui::ColorEdit4("Color", reinterpret_cast<float*>(&settings.color), ImGuiColorEditFlags_NoInputs);
|
||||
ImGui::SliderFloat("Radius", &settings.radius, 1.f, 12.f);
|
||||
ImGui::SliderFloat("Radius", &settings.radius, 1.f, max_radius);
|
||||
ImGui::SliderFloat("Intensity", &settings.intensity, 0.f, 1.f);
|
||||
}
|
||||
ImGui::PopID();
|
||||
@@ -86,6 +86,7 @@ namespace imgui_desktop::gui
|
||||
ImGui::SliderFloat("Top Y", &m_entity_top_y, 20.f, m_entity_bottom_y - 20.f);
|
||||
ImGui::SliderFloat("Bottom Y", &m_entity_bottom_y, m_entity_top_y + 20.f, vp->Size.y - 20.f);
|
||||
ImGui::SliderFloat("Aspect", &m_entity_aspect, 1.f, 10.f);
|
||||
draw_glow_controls("Canvas light", m_canvas_glow, 500.f);
|
||||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Box", ImGuiTreeNodeFlags_DefaultOpen))
|
||||
@@ -256,6 +257,7 @@ namespace imgui_desktop::gui
|
||||
const auto cornered_box_glow = make_glow(m_cornered_box_glow);
|
||||
const auto bar_glow = make_glow(m_bar_glow);
|
||||
const auto label_glow = make_glow(m_label_glow);
|
||||
const auto canvas_glow = make_glow(m_canvas_glow);
|
||||
const Paint vertical_bar_color =
|
||||
m_gradient_bars ? Paint{omath::hud::Gradient{bar_value_color, bar_value_color, red, red}}
|
||||
: Paint{m_bar_color};
|
||||
@@ -283,6 +285,7 @@ namespace imgui_desktop::gui
|
||||
omath::hud::EntityOverlay({m_entity_x, m_entity_top_y}, {m_entity_x, m_entity_bottom_y}, m_entity_aspect,
|
||||
std::make_shared<omath::hud::ImguiHudRenderer>())
|
||||
.contents(
|
||||
when(canvas_glow.has_value(), CanvasGlow{canvas_glow.value_or(Glow{m_canvas_glow.color})}),
|
||||
// ── Boxes ────────────────────────────────────────────────────
|
||||
when(m_show_box, Box{m_box_color, box_fill, m_box_outline, m_box_thickness, box_glow}),
|
||||
when(m_show_cornered_box,
|
||||
|
||||
Reference in New Issue
Block a user