Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
rune::Mouse Class Reference

Interface for getting input from the mouse. More...

#include <mouse.h>

Public Types

enum  Button {
  Left = 0, Right = 1, Middle = 2, XButton1 = 3,
  XButton2 = 4
}
 A button on the mouse that can be polled for input status. More...
 

Static Public Member Functions

static bool isButtonPressed (rune::Mouse::Button button)
 
static rune::Vec2 getPosition (void)
 
static void setPosition (rune::Vec2 newPosition)
 Set the position of the cursor.
 

Detailed Description

Interface for getting input from the mouse.

Author
Thomas Montano
Date
May 21 2020

Member Enumeration Documentation

◆ Button

A button on the mouse that can be polled for input status.

Enumerator
Left 

The left mouse button.

Right 

The right mouse button.

Middle 

The middle mouse button.

XButton1 

The first extra button on the mouse.

XButton2 

The second extra button on the mouse.

Member Function Documentation

◆ getPosition()

rune::Vec2 rune::Mouse::getPosition ( void  )
static

Returns the position of the mouse in screen coordinates. Bottom left of screen is (0,0).

Returns
The location of the mouse cursor in screen coordinates.

◆ isButtonPressed()

bool rune::Mouse::isButtonPressed ( rune::Mouse::Button  button)
static

Determines whether or not the button is being pressed at the time of function call.

Parameters
buttonThe button to be looked at.
Returns
Whether or not the button is being pressed.

The documentation for this class was generated from the following files: