Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GlobalMouseInfo

Hierarchy

Implements

Index

Properties

Readonly event

event: IEventEmitter<this, IGlobalMouseInfoEvents> = new EventEmitter<this, E>(this)

position

position: Vector2 = Vector2.ZERO

The current position of the mouse.

Accessors

target

  • The component the mouse is currently hovering over. null if the hovered element has no associated component.

    Returns Component | null

targetElement

  • get targetElement(): HTMLElement | undefined
  • The element the mouse is currently hovering over.

    Returns HTMLElement | undefined

Methods

invalidateTarget

  • invalidateTarget(): void
  • Returns void

isTarget

  • isTarget<W>(what?: W, recalcTarget?: boolean): false
  • Returns whether the mouse is currently within the given component, element, or selector.

    Type parameters

    Parameters

    • Optional what: W

      A component, element, or selector.

    • Default value recalcTarget: boolean = false

      Whether to recalculate the target before this operation. Defaults to false

    Returns false

isWithin

  • isWithin<W>(what?: W, recalcTarget?: boolean): (W extends Component<HTMLElement> ? W : HTMLElement) | false
  • Returns whether the mouse is currently within the given component, element, or selector, or its descendants.

    Type parameters

    Parameters

    • Optional what: W

      A component, element, or selector.

    • Default value recalcTarget: boolean = false

      Whether to recalculate the target before this operation. Defaults to false

    Returns (W extends Component<HTMLElement> ? W : HTMLElement) | false

update

  • update(evt: Event & Partial<MouseEvent> & Partial<TouchEvent>): void
  • Parameters

    • evt: Event & Partial<MouseEvent> & Partial<TouchEvent>

    Returns void

updateTarget

  • updateTarget(): void
  • Forces a target update. Don't call this unless you absolutely have to, it's a perf hog.

    Returns void

Generated using TypeDoc