Table of Contents

Struct MouseButtonSnapshot

Namespace
TileWorld.Engine.Input
Assembly
TileWorld.Engine.dll

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

IsDown bool

Whether the button is currently pressed.

WentDown bool

Whether the button transitioned to pressed this frame.

WentUp bool

Whether the button transitioned to released this frame.

Properties

IsDown

Whether the button is currently pressed.

public bool IsDown { get; init; }

Property Value

bool

WentDown

Whether the button transitioned to pressed this frame.

public bool WentDown { get; init; }

Property Value

bool

WentUp

Whether the button transitioned to released this frame.

public bool WentUp { get; init; }

Property Value

bool

Methods

FromStates(bool, bool)

Creates a button snapshot from current and previous button states.

public static MouseButtonSnapshot FromStates(bool isDown, bool wasDown)

Parameters

isDown bool

Whether the button is currently pressed.

wasDown bool

Whether the button was pressed on the previous frame.

Returns

MouseButtonSnapshot

A snapshot containing current-state and edge-transition information.