Expand description
Types and systems for pointer inputs, such as position and buttons.
The picking system is built around the concept of a ‘Pointer’, which is an
abstract representation of a user input with a specific screen location. The cursor
and touch input is provided under crate::input
, but you can also implement
your own custom pointers by supplying a unique ID.
The purpose of this module is primarily to provide a common interface that can be driven by lower-level input devices and consumed by higher-level interaction systems.
Structs§
- Location
- The location of a pointer, including the current
NormalizedRenderTarget
, and the x/y position of the pointer on this render target. - Pointer
Input - An input event effecting a pointer.
- Pointer
Interaction - Holds a list of entities this pointer is currently interacting with, sorted from nearest to farthest.
- Pointer
Location - Component that tracks a pointer’s current
Location
. - Pointer
Map - A resource that maps each
PointerId
to theirEntity
for easy lookups. - Pointer
Press - Tracks the state of the pointer’s buttons in response to
PointerInput
events.
Enums§
- Pointer
Action - Types of actions that can be taken by pointers.
- Pointer
Button - The button that was just pressed or released
- Pointer
Id - Identifies a unique pointer entity.
Mouse
andTouch
pointers are automatically spawned. - Press
Direction - The stage of the pointer button press event
Functions§
- update_
pointer_ map - Update the
PointerMap
resource with the current frame’s data.