ChaiLove API  0.28.0
Public Member Functions
love::mouse Class Reference

Provides an interface to the user's mouse. More...

Public Member Functions

int getX ()
 Returns the current x-position of the mouse. More...
 
int getY ()
 Returns the current y-position of the mouse. More...
 
Types::Graphics::Point getPosition ()
 Returns the current position of the mouse. More...
 
bool isDown (int button)
 Checks whether a certain button is down. More...
 
bool isDown (const std::string &button)
 Checks whether a certain button is down. More...
 

Detailed Description

Provides an interface to the user's mouse.

Member Function Documentation

◆ getPosition()

Types::Graphics::Point love::mouse::getPosition ( )

Returns the current position of the mouse.

See also
love.mouse.getX
love.mouse.getY

◆ getX()

int love::mouse::getX ( )

Returns the current x-position of the mouse.

Returns
The position of the mouse along the x-axis.
See also
love.mouse.getY

◆ getY()

int love::mouse::getY ( )

Returns the current y-position of the mouse.

Returns
The position of the mouse along the y-axis.
See also
love.mouse.getX

◆ isDown() [1/2]

bool love::mouse::isDown ( int  button)

Checks whether a certain button is down.

Parameters
buttonThe index of a button to check. 1 is the primary mouse button, 2 is the secondary mouse button and 3 is the middle button. Further buttons are mouse dependant.
Returns
True if the specified button is down.

◆ isDown() [2/2]

bool love::mouse::isDown ( const std::string &  button)

Checks whether a certain button is down.

Parameters
buttonThe mouse button to check. "left", "middle", "right", etc.
Returns
True if the specified button is down.