From b6bebcf37dbb61dab58da63ac81d61da072ba8d4 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 16 Dec 2022 16:54:40 -0800 Subject: [PATCH] Show coordinates on mouse move --- pkNX.WinForms/Subforms/MapViewer9.Designer.cs | 1 + pkNX.WinForms/Subforms/MapViewer9.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/pkNX.WinForms/Subforms/MapViewer9.Designer.cs b/pkNX.WinForms/Subforms/MapViewer9.Designer.cs index 005c4878..54ddb9b6 100644 --- a/pkNX.WinForms/Subforms/MapViewer9.Designer.cs +++ b/pkNX.WinForms/Subforms/MapViewer9.Designer.cs @@ -42,6 +42,7 @@ private void InitializeComponent() this.pictureBox1.Size = new System.Drawing.Size(597, 591); this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; + this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove); // // CB_Map // diff --git a/pkNX.WinForms/Subforms/MapViewer9.cs b/pkNX.WinForms/Subforms/MapViewer9.cs index c7b43564..62a3efb4 100644 --- a/pkNX.WinForms/Subforms/MapViewer9.cs +++ b/pkNX.WinForms/Subforms/MapViewer9.cs @@ -189,6 +189,12 @@ private void UpdateMap(int map) } } + private void pictureBox1_MouseMove(object sender, MouseEventArgs e) + { + var x = ((e.X * 5000.0f) / pictureBox1.Width); + var z = ((e.Y * 5000.0f) / pictureBox1.Height) - 5500f; + Text = $"X: {x}, Z: {z}"; + } } public class AreaDef9 {