[Input] Improved MouseState.ToString()

This commit is contained in:
thefiddler 2014-05-04 08:31:11 +02:00
parent 94fdf1881c
commit 39eb3b1892
2 changed files with 12 additions and 1 deletions

View file

@ -72,7 +72,7 @@ namespace OpenTK.Input
/// <returns>A <see cref="System.String"/> that represents the current <see cref="OpenTK.Input.MouseScrollWheel"/>.</returns>
public override string ToString()
{
return string.Format("[MouseScrollWheel: X={0}, Y={1}]", X, Y);
return string.Format("[X={0:0.00}, Y={1:0.00}]", X, Y);
}
/// <summary>

View file

@ -257,6 +257,17 @@ namespace OpenTK.Input
return buttons.GetHashCode() ^ X.GetHashCode() ^ Y.GetHashCode() ^ scroll.GetHashCode();
}
/// <summary>
/// Returns a <see cref="System.String"/> that represents the current <see cref="OpenTK.Input.MouseState"/>.
/// </summary>
/// <returns>A <see cref="System.String"/> that represents the current <see cref="OpenTK.Input.MouseState"/>.</returns>
public override string ToString()
{
string b = Convert.ToString(buttons, 2).PadLeft(10, '0');
return String.Format("[MouseState: X={0}, Y={1}, Scroll={2}, Buttons={3}, IsConnected={4}]",
X, Y, Scroll, b, IsConnected);
}
#endregion
#region Internal Members