MouseInfo
Namespace: MonineEngine.Input
public class MouseInfo
Inheritance Object → MouseInfo
Properties
PreviousState
The state of mouse input during the previous update cycle.
public MouseState PreviousState { get; private set; }
Property Value
MouseState
CurrentState
The state of mouse input during the current update cycle.
public MouseState CurrentState { get; private set; }
Property Value
MouseState
Position
The current position of the mouse cursor in screen space.
public Point Position { get; set; }
Property Value
Point
X
The current X coordinate of the mouse cursor in screen space.
public int X { get; set; }
Property Value
Y
The current Y coordinate of the mouse cursor in screen space.
public int Y { get; set; }
Property Value
PositionDelta
The difference in the mouse cursor position between the previous and current frame.
public Point PositionDelta { get; }
Property Value
Point
XDelta
The difference in the mouse cursor X coordinate between the previous and current frame.
public int XDelta { get; }
Property Value
YDelta
The difference in the mouse cursor Y coordinate between the previous and current frame.
public int YDelta { get; }
Property Value
WasMoved
Tracks if the mouse cursor was moved between the previous and current frames.
public bool WasMoved { get; }
Property Value
ScrollWheel
The cumulative value of the mouse scroll wheel since the start of the game.
public int ScrollWheel { get; }
Property Value
ScrollWheelDelta
The value of the scroll wheel between the previous and current frame.
public int ScrollWheelDelta { get; }
Property Value
Constructors
MouseInfo()
Constructs a new MouseInfo.
public MouseInfo()
Methods
Update()
Updates the state information about mouse input.
public void Update()
IsButtonDown(MouseButton)
Checks if the specified mouse button is currently down.
public bool IsButtonDown(MouseButton button)
Parameters
button MouseButton
The mouse button to check.
Returns
Boolean
If the specified mouse button is currently down, true. Otherwise, false.
IsButtonUp(MouseButton)
Checks if the specified mouse button is currently up.
public bool IsButtonUp(MouseButton button)
Parameters
button MouseButton
The mouse button to check.
Returns
Boolean
If the specified mouse button is currently up, true. Otherwise, false.
WasButtonPressed(MouseButton)
Checks if the specified mouse button was just pressed on the current frame.
public bool WasButtonPressed(MouseButton button)
Parameters
button MouseButton
The mouse button to check.
Returns
Boolean
If the specified mouse button was just pressed on the current frame, true. Otherwise, false.
WasButtonReleased(MouseButton)
Checks if the specified mouse button was just released on the current frame.
public bool WasButtonReleased(MouseButton button)
Parameters
button MouseButton
The mouse button to check.
Returns
Boolean
If the specified mouse button was just released on the current frame, true. Otherwise, false.
SetPosition(Int32, Int32)
Sets the current position of the mouse cursor in screen space and updates the CurrentState with the new position.
public void SetPosition(int x, int y)
Parameters
x Int32
The X coordinate location of the mouse cursor in screen space.
y Int32
The Y coordinate location of the mouse cursor in screen space.