1
0
mirror of synced 2024-11-28 09:30:51 +01:00

impr: Added shadow to tutorial popups

This commit is contained in:
WerWolv 2023-12-13 23:44:53 +01:00
parent f000b6bc0a
commit 5b77f511d3

View File

@ -109,8 +109,12 @@ namespace hex {
if (windowPos.y < mainWindowPos.y) if (windowPos.y < mainWindowPos.y)
windowPos.y = mainWindowPos.y + 10_scaled; windowPos.y = mainWindowPos.y + 10_scaled;
auto &style = ImGui::GetStyle();
ImVec2 shadowOffset = ImVec2(ImCos(style.WindowShadowOffsetAngle), ImSin(style.WindowShadowOffsetAngle)) * style.WindowShadowOffsetDist;
drawList->AddRectFilled(windowPos, windowPos + windowSize, ImGui::GetColorU32(ImGuiCol_WindowBg) | 0xFF000000); drawList->AddRectFilled(windowPos, windowPos + windowSize, ImGui::GetColorU32(ImGuiCol_WindowBg) | 0xFF000000);
drawList->AddRect(windowPos, windowPos + windowSize, ImGui::GetColorU32(ImGuiCol_Border)); drawList->AddRect(windowPos, windowPos + windowSize, ImGui::GetColorU32(ImGuiCol_Border));
drawList->AddShadowRect(windowPos, windowPos + windowSize, ImGui::GetColorU32(ImGuiCol_WindowShadow), style.WindowShadowSize, shadowOffset, ImDrawFlags_ShadowCutOutShapeBackground);
drawList->AddText(nullptr, 0.0F, windowPos + margin, ImGui::GetColorU32(ImGuiCol_Text), text, nullptr, windowSize.x - margin.x * 2); drawList->AddText(nullptr, 0.0F, windowPos + margin, ImGui::GetColorU32(ImGuiCol_Text), text, nullptr, windowSize.x - margin.x * 2);
} }
} }