spawn popup at center
This commit is contained in:
@@ -376,7 +376,9 @@ public class DDDView extends GameAdapter implements CommandSender {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void renderPopup(String title, String text) {
|
private void renderPopup(String title, String text) {
|
||||||
if (ImGui.beginPopupModal(title, null, ImGuiWindowFlags.AlwaysAutoResize)) {
|
ImVec2 center = ImGui.getMainViewport().getCenter();
|
||||||
|
ImGui.setNextWindowPos(center, ImGuiCond.Appearing, new ImVec2(0.5f, 0.5f));
|
||||||
|
if (ImGui.beginPopupModal(title, null, ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoMove)) {
|
||||||
ImGui.text(text);
|
ImGui.text(text);
|
||||||
if (ImGui.button("Close")) {
|
if (ImGui.button("Close")) {
|
||||||
ImGui.closeCurrentPopup();
|
ImGui.closeCurrentPopup();
|
||||||
|
|||||||
Reference in New Issue
Block a user