Elaztek Developer Hub
Blamite Game Engine - Strings
A library containing general purpose utilities and classes for use in multiple projects.
MouseClickEvent Class Reference

Class representing a mouse button press. More...

#include <MouseClickEvent.h>

+ Inheritance diagram for MouseClickEvent:
+ Collaboration diagram for MouseClickEvent:

Public Member Functions

 MouseClickEvent (uint8_t _button, int _x, int _y)
 Constructs a new event. More...
 
uint8_t GetButton ()
 Retrieves the mouse button that was pressed. More...
 
int GetX ()
 Retrieves the mouse X position, relative to the window. More...
 
int GetY ()
 Retrieves the mouse Y position, relative to the window. More...
 
- Public Member Functions inherited from BlamEvent
 BlamEvent (BlamEventType type)
 Constructs a new event with the specified type. More...
 
BlamEventType GetEventType ()
 Retrieves the type of the event. More...
 
void SetCancelled (bool cancel)
 Sets whether or not the event should be cancelled. More...
 
bool IsCancelled ()
 Determines whether or not the event has been cancelled. More...
 

Detailed Description

Class representing a mouse button press.

This event is fired from the SDL_MOUSEBUTTONDOWN event.

Constructor & Destructor Documentation

◆ MouseClickEvent()

MouseClickEvent::MouseClickEvent ( uint8_t  _button,
int  _x,
int  _y 
)

Constructs a new event.

Parameters
_button- The clicked mouse button ID.
_x- The X coordinate at the time of the click.
_y- The Y coordinate at the time of the click.

Member Function Documentation

◆ GetButton()

uint8_t MouseClickEvent::GetButton ( )

Retrieves the mouse button that was pressed.

Returns
The pressed mouse button.

◆ GetX()

int MouseClickEvent::GetX ( )

Retrieves the mouse X position, relative to the window.

Returns
The mouse X coordinate.

◆ GetY()

int MouseClickEvent::GetY ( )

Retrieves the mouse Y position, relative to the window.

Returns
The mouse Y coordinate.

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