public static SNVector2 ToSystemNumerics(this VPoint point) => new SNVector2(point.X, point.Y);
private void RenderMainMenu() { bool isCollapsed = !ImGui.Begin( "Overlay Main Menu", ref state.IsRunning, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.AlwaysAutoResize); if (!state.IsRunning || isCollapsed) { ImGui.End(); if (!state.IsRunning) { Close(); } return; } ImGui.Text("Try pressing F12 button to show/hide this menu."); ImGui.Text("Click X on top right of this menu to close the overlay."); ImGui.Checkbox("Show non-clickable transparent overlay Sample 1.", ref state.ShowOverlaySample1); ImGui.Checkbox("Show full-screen non-clickable transparent overlay sample 2.", ref state.OverlaySample2.Show); ImGui.NewLine(); if (ImGui.InputInt("Set To Display", ref state.CurrentDisplay)) { var box = GetDisplayBounds(state.CurrentDisplay); state.resizeHelper[0] = box.X; state.resizeHelper[1] = box.Y; state.resizeHelper[2] = box.Width; state.resizeHelper[3] = box.Height; } ImGui.SliderInt2("Set Position", ref state.resizeHelper[0], 0, 3840); ImGui.SliderInt2("Set Size", ref state.resizeHelper[2], 0, 3840); if (ImGui.Button("Resize")) { Position = new Veldrid.Point(state.resizeHelper[0], state.resizeHelper[1]); Size = new Veldrid.Point(state.resizeHelper[2], state.resizeHelper[3]); } ImGui.NewLine(); ImGui.SliderInt("###time(sec)", ref state.Seconds, 1, 30); if (ImGui.Button($"Hide for {state.Seconds} seconds")) { state.Visible = false; state.ReappearTimeRemaining = state.Seconds; } ImGui.NewLine(); ImGui.SliderInt("###sleeptime(sec)", ref state.SleepInSeconds, 1, 30); if (ImGui.Button($"Sleep Render Thread for {state.SleepInSeconds} seconds")) { Thread.Sleep(TimeSpan.FromSeconds(state.SleepInSeconds)); } if (ImGui.Button($"Sleep Logic Thread for {state.SleepInSeconds} seconds")) { state.RequestLogicThreadSleep = true; } ImGui.NewLine(); if (ImGui.Button($"Request Logic Thread to close Overlay.")) { state.LogicThreadCloseOverlay = true; } ImGui.NewLine(); ImGui.SliderInt("Logical Thread Delay(ms)", ref state.LogicTickDelayInMilliseconds, 1, 1000); ImGui.NewLine(); if (ImGui.Button("Toggle ImGui Demo")) { state.ShowImGuiDemo = !state.ShowImGuiDemo; } ImGui.NewLine(); if (File.Exists("image.png")) { AddOrGetImagePointer( "image.png", out IntPtr imgPtr, out uint w, out uint h); ImGui.Image(imgPtr, new Vector2(w, h)); } else { ImGui.Text("Put any image where the exe is, name is 'image.png'"); } ImGui.End(); }