q5play
    Preparing search index...

    Class _Mouse

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    canvasPos: { x: number; y: number }

    The mouse's absolute position on the canvas.

    center: number

    The mouse's center button.

    drag: {}

    Contains the drag status of each of the mouse's buttons.

    holdThreshold: number

    The amount of frames an input must be pressed to be considered held.

    12
    
    isActive: boolean

    True if the mouse has ever interacted with the canvas.

    false
    
    isOnCanvas: boolean

    True if the mouse is currently on the canvas.

    false
    
    left: number

    The mouse's left button.

    right: number

    The mouse's right button.

    scrollDelta: { x: number; y: number }

    Contains the scroll status of the mouse wheel.

    x: number

    The mouse's x position in the world.

    y: number

    The mouse's y position in the world.

    Accessors

    • get cursor(): string

      The mouse's CSS cursor style.

      Returns string

      'default'
      
    • set cursor(val: string): void

      Parameters

      • val: string

      Returns void

    • get pos(): { x: number; y: number }

      Gets the mouse's current position in the world as a readonly object {x, y} that won't updated if the mouse moves.

      Returns { x: number; y: number }

    • get position(): { x: number; y: number }

      The mouse's current position.

      Returns { x: number; y: number }

    • get visible(): boolean

      Controls whether the mouse is visible or not.

      Returns boolean

      true
      
    • set visible(val: boolean): void

      Parameters

      • val: boolean

      Returns void

    Methods

    • Parameters

      • Optionalinp: string

      Returns boolean

      true on the first frame that the user releases the input after dragging the mouse

    • Parameters

      • Optionalinp: string

      Returns number

      the amount of frames the user has been moving the mouse while pressing the input

    • Parameters

      • Optionalinp: string

      Returns boolean

      true on the first frame that the user moves the mouse while pressing the input

    • Parameters

      • Optionalinp: string

      Returns boolean

      true on the first frame that the user released a held input

    • Parameters

      • Optionalinp: string

      Returns number

      the amount of frames the user has been holding the input

    • Parameters

      • Optionalinp: string

      Returns boolean

      true on the first frame that the user holds the input

    • Same as the released function, which is preferred.

      Parameters

      • Optionalinp: string

      Returns boolean

      true on the first frame that the user released the input

    • Parameters

      • Optionalinp: string

      Returns boolean

      true on the first frame that the user presses the input

    • Parameters

      • Optionalinp: string

      Returns number

      the amount of frames the user has been pressing the input

    • Parameters

      • Optionalinp: string

      Returns boolean

      true on the first frame that the user released the input

    • Returns boolean

      true on the first frame that the user stops scrolling the mouse wheel

    • Returns number

      the amount of frames the user has been scrolling the mouse wheel

    • Returns boolean

      true on the first frame that the user scrolls the mouse wheel