Struct MouseButtonSnapshot
Describes the current and edge-transition state of a mouse button.
public readonly record struct MouseButtonSnapshot : IEquatable<MouseButtonSnapshot>
- Implements
- Inherited Members
Constructors
MouseButtonSnapshot(bool, bool, bool)
Describes the current and edge-transition state of a mouse button.
public MouseButtonSnapshot(bool IsDown, bool WentDown, bool WentUp)
Parameters
IsDownboolWhether the button is currently pressed.
WentDownboolWhether the button transitioned to pressed this frame.
WentUpboolWhether the button transitioned to released this frame.
Properties
IsDown
Whether the button is currently pressed.
public bool IsDown { get; init; }
Property Value
WentDown
Whether the button transitioned to pressed this frame.
public bool WentDown { get; init; }
Property Value
WentUp
Whether the button transitioned to released this frame.
public bool WentUp { get; init; }
Property Value
Methods
FromStates(bool, bool)
Creates a button snapshot from current and previous button states.
public static MouseButtonSnapshot FromStates(bool isDown, bool wasDown)
Parameters
isDownboolWhether the button is currently pressed.
wasDownboolWhether the button was pressed on the previous frame.
Returns
- MouseButtonSnapshot
A snapshot containing current-state and edge-transition information.