Show coordinates on mouse move

This commit is contained in:
Kurt
2022-12-16 16:54:40 -08:00
parent 7c804255bc
commit b6bebcf37d
2 changed files with 7 additions and 0 deletions

View File

@@ -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
//

View File

@@ -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
{