Welcome Installation Getting Started User Interaction Build a Game #1 Build a Game #2 Build a Game #3 Colours Coordinates API Reference Globals Window Camera Mouse Key Rect Image Text Shape Line Screen Sound Base

Mouse

The mouse handles cursor input.


    
__init__(x = auto, y = auto)

Call the mouse initialiser. Use this to reset its position.

  • x: float

    The x position of the mouse

  • y: float

    The y position of the mouse

x: float

The x position of the mouse.

y: float

The y position of the mouse.

pos, position: float, float

The position of the mouse.

  • x: float

    The mouse x position

  • y: float

    The mouse y position

move: float, float

The movement of the mouse since the last frame. This attribute can also be interpreted as a bool, which you can use it to detect when the mouse moves.

  • x: float

    The mouse x movement

  • y: float

    The mouse y movement

press: bool

A mouse button was pressed.

release: bool

A mouse button was released.

left, middle, right, x1, x2: object

Get the state of the corresponding mouse button.

  • press: bool

    The mouse button was pressed

  • release: bool

    The mouse button was released

  • down: bool

    The mouse button is held down

Camera Key