cursor.py

System/custom mouse cursor state handling for LunaEngine.

class CursorManager

Description

Resolve named UI cursor states and image-backed custom cursors.

Attributes
_SYSTEM_NAMES: Any = {'arrow': 'SYSTEM_CURSOR_ARROW', 'hand': 'SYSTEM_CURSOR_HAND', 'ibeam': 'SYSTEM_CURSOR_IBEAM', 'crosshair': 'SYSTEM_CURSOR_CROSSHAIR', 'resize_h': 'SYSTEM_CURSOR_SIZEWE', 'resize_v': 'SYSTEM_CURSOR_SIZENS', 'sizeall': 'SYSTEM_CURSOR_SIZEALL', 'wait': 'SYSTEM_CURSOR_WAIT', 'no': 'SYSTEM_CURSOR_NO'}
Methods
def __init__(self: Any) -> None
No documentation
def _warn_fallback(self: Any, source: Any) -> bool
No documentation
def _set_named(self: Any, state: str) -> bool
No documentation
def _surface_from_source(self: Any, source: Any) -> Any
No documentation
def _custom_cursor(self: Any, source: Any) -> Any
No documentation
def set_state(self: Any, name: object = 'arrow') -> bool
Apply a preset or custom cursor source and return success.

Custom sources may be a ``pygame.Cursor``, ``pygame.Surface``,
``AtlasItem``, ``Icon``, ``pathlib.Path``, string path, or graphics
``Image``. Custom image cursors use a centered hotspot and are cached
by source identity. Invalid sources warn, fall back to the arrow, and
never raise.
Back to Core Module