Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Input

Index

Methods

Static getInputPosition

  • Returns the input position in screen pixels. For touch input this is the first touch. For mouse input, it is the mouse position.

    Returns Vector2

Static getKey

  • Returns true if the key is currently held down.

    Parameters

    Returns boolean

Static getKeyDown

  • getKeyDown(key: KeyCode): boolean
  • Returns true if the key was pressed in the current frame.

    Parameters

    Returns boolean

Static getKeyUp

  • Returns true if the key was released in the current frame.

    Parameters

    Returns boolean

Static getMouseButton

  • getMouseButton(button: number): boolean
  • Returns true if the mouse button is currently held down.

    Parameters

    • button: number

    Returns boolean

Static getMouseButtonDown

  • getMouseButtonDown(button: number): boolean
  • Returns true if the mouse button was pressed in the current frame.

    Parameters

    • button: number

    Returns boolean

Static getMouseButtonUp

  • getMouseButtonUp(button: number): boolean
  • Returns true if the mouse button was released in the current frame.

    Parameters

    • button: number

    Returns boolean

Static getTouch

  • getTouch(index: number): Touch
  • Retrieves information for a specific touch point. The index ranges from 0 to the value returned by TouchCount.

    Parameters

    • index: number

    Returns Touch

Static getWorldInputPosition

  • Convenience function that returns the value from GetInputPosition transformed into world space. World space includes the camera transform of the camera closest to the input position. This is the same as TranslateScreenToWorld(world, GetInputPosition()); In 2D setups, the world z coordinate is always set to 0.

    Parameters

    Returns Vector3

Static isMouseEmulated

  • isMouseEmulated(): boolean
  • Returns true if mouse events are emulated by other input devices, such as touch.

    Returns boolean

Static isMousePresent

  • isMousePresent(): boolean
  • Returns true if the current device produces mouse input.

    Returns boolean

Static isTouchSupported

  • isTouchSupported(): boolean
  • Returns true if the current device produces touch input responses. This value may not be accurate until a first touch occurs.

    Returns boolean

Static touchCount

  • touchCount(): number
  • Returns the number of currently active touches.

    Returns number

Static translateScreenToWorld

  • Transforms Screen coordinates into World coordinates. World space includes the camera transform of the camera closest to the input coordinate. In 2D setups, the world z coordinate is always set to 0.

    Parameters

    Returns Vector3

Generated using TypeDoc