Skip to content

useMouse 0.1.0 view source

function useMouse(
  scope: Fusion.Scope,
  observer: (mouse: Vector2) -> ()?
): Fusion.StateObject<Vector2>

Returns a state object with the mouse position. Updates when the mouse position changes.


Parameters

scope : Fusion.Scope

The scope to store cleanup tasks.

observer : (mouse: Vector2) -> ()?

Optional observer tracking the mouse position.


Returns -> Fusion.StateObject<Vector2>

A state object with the mouse position.


Example Usage

-- TODO: write example