Table of Contents

Interface IMouseProvider

Namespace
SimulationFramework.Input
Assembly
SimulationFramework.dll

Provides mouse input to the simulation.

public interface IMouseProvider : ISimulationComponent, IDisposable
Inherited Members

Properties

DeltaPosition

The distance the mouse position has moved since the last frame, in pixels.

Vector2 DeltaPosition { get; }

Property Value

Vector2

HeldButtons

Gets a collection of all buttons which are held this frame.

IEnumerable<MouseButton> HeldButtons { get; }

Property Value

IEnumerable<MouseButton>

Position

Gets or sets the mouse position in pixels relative to the origin of the window's contents.

Vector2 Position { get; set; }

Property Value

Vector2

PressedButtons

Gets a collection of all buttons pressed this frame. A key is only considered pressed on the first frame that it is held.

IEnumerable<MouseButton> PressedButtons { get; }

Property Value

IEnumerable<MouseButton>

ReleasedButtons

Gets a collection of all buttons released this frame. A key is only considered released on the first frame that it is not held.

IEnumerable<MouseButton> ReleasedButtons { get; }

Property Value

IEnumerable<MouseButton>

ScrollWheelDelta

The scroll wheel movement since the last frame.

float ScrollWheelDelta { get; }

Property Value

float

Visible

Whether the mouse cursor is visible.

bool Visible { get; set; }

Property Value

bool

Methods

SetCursor(SystemCursor)

Sets the mouse cursor to a system cursor.

void SetCursor(SystemCursor cursor)

Parameters

cursor SystemCursor

SetCursor(ReadOnlySpan<Color>, int, int, int, int)

Sets the mouse cursor to a custom image.

void SetCursor(ReadOnlySpan<Color> cursor, int width, int height, int anchorX, int anchorY)

Parameters

cursor ReadOnlySpan<Color>
width int
height int
anchorX int
anchorY int

Events

ButtonPressed

Invoked when a button is pressed.

event MouseButtonEvent ButtonPressed

Event Type

MouseButtonEvent

ButtonReleased

Invoked when a button is released

event MouseButtonEvent ButtonReleased

Event Type

MouseButtonEvent