MouseInput

A class to handle mouse input.

Members

(static, readonly) BUTTON :number

Enum for mouse buttons.

Type:
  • number
Properties
NameTypeDescription
LEFTnumber

Left mouse button.

LEFTnumber
MIDDLEnumber
RIGHTnumber

Methods

(static) GetPosition() → {Vector2}

Get the current mouse position.

Returns:

The current mouse position.

Type: 
Vector2

(static) IsButtonDown(button) → {boolean}

Check if a button is currently down.

Parameters:
NameTypeDescription
buttonMouseInput.BUTTON

The button to check. Use MouseInput.buttons enum.

Returns:

True if the specified button is down.

Type: 
boolean

(static) IsButtonUp(button) → {boolean}

Check if a button is currently up.

Parameters:
NameTypeDescription
buttonMouseInput.BUTTON

The button to check. Use MouseInput.buttons enum.

Returns:

True if the specified button is up.

Type: 
boolean

(static) IsClicked(button) → {boolean}

Check if a button was clicked.

Parameters:
NameTypeDescription
buttonMouseInput.BUTTON

The button to check. Use MouseInput.buttons enum.

Returns:

True if the specified button was clicked.

Type: 
boolean