My Project
|
GraphicalLib class. More...
#include <GraphicalLib.hpp>
Public Member Functions | |
GraphicalLib () | |
Construct a new Graphical Lib object. More... | |
~GraphicalLib () | |
Destroy the Graphical Lib object. More... | |
void | initWindow (const int screenWidth, const int screenHeight, std::string title, const int framerate) override |
A method to initialize a window object. More... | |
void | closeWindow () override |
A method to close a window. More... | |
void | clearScreen () override |
Clear the window. More... | |
void | startDrawingWindow () override |
Start drawing in the window. More... | |
void | endDrawingWindow () override |
Stop drawing in the window. More... | |
bool | windowShouldClose () override |
Check if the window should close. More... | |
void | drawSprite (MyTexture const &texture, std::array< float, 4 > const &rectSource, std::array< float, 4 > const &rectDest, std::pair< float, float > const &origin, float const &rotation, float const &scale) override |
A method to draw a sprite. More... | |
bool | checkMouseCollision (Position const &position, float const &x, float const &y, float const &height, float const &width) override |
A method to check a collison between the mouse and a rectangle. More... | |
bool | IsLeftMouseButtonPressed () override |
A method to check if the left mouse button is pressed. More... | |
bool | IsLeftMouseButtonReleased () override |
A method to check if the left mouse button is released. More... | |
Position | getMousePosition () override |
Get the Mouse Position object. More... | |
Color | createColor (std::array< float, 4 > const &array) override |
Create a Color object. More... | |
void | drawText (std::string const &text, Position const &pos, std::size_t const &fontSize, std::array< float, 4 > const &color) override |
A method to draw a text. More... | |
void | initAudio () override |
A method to init the audio devide. More... | |
void | closeAudio () override |
A method to close the audio device. More... | |
void | playASound (MySound &sound) override |
A method to play a sound. More... | |
void | playASoundMulti (MySound &sound) override |
Play a sound with a multichannel buffer pool. More... | |
void | playAMusic (MyMusic &music) override |
A method to load a sound. More... | |
void | updateAMusic (MyMusic &music) override |
A method to update the music. More... | |
float | getMusicVolume (MyMusic &music) override |
void | setMusicVolume (MyMusic &music, float volume) override |
bool | hasBeenPressed (int key) override |
Check if a key has been pressed. More... | |
bool | isBeingPressed (int key) override |
Check if a key is being pressed. More... | |
bool | hasBeenReleased (int key) override |
Check if a key has been released. More... | |
bool | isNotBeingPressed (int key) override |
Check if a key is not being pressed. More... | |
void | setExitKey (int key) override |
Set the Exit Key object. More... | |
int | getPressedKeycode () override |
Get the Pressed Keycode object. More... | |
int | getPressedCharcode () override |
Get the Pressed Charcode object. More... | |
Public Member Functions inherited from rtype::IGraphicalLib | |
virtual | ~IGraphicalLib ()=default |
Destroy the IGraphicalLib object. | |
GraphicalLib class.
rtype::GraphicalLib::GraphicalLib | ( | ) |
Construct a new Graphical Lib object.
rtype::GraphicalLib::~GraphicalLib | ( | ) |
Destroy the Graphical Lib object.
|
overridevirtual |
A method to check a collison between the mouse and a rectangle.
position | position of the mouse |
x | x position of the rectangle |
y | y position of the rectangle |
height | height of the rectangle |
width | width of the rectangle |
Implements rtype::IGraphicalLib.
|
overridevirtual |
Clear the window.
Implements rtype::IGraphicalLib.
|
overridevirtual |
A method to close the audio device.
Implements rtype::IGraphicalLib.
|
overridevirtual |
A method to close a window.
Implements rtype::IGraphicalLib.
|
overridevirtual |
Create a Color object.
array | correspond to the red, green, blue and alpha values |
Implements rtype::IGraphicalLib.
|
overridevirtual |
A method to draw a sprite.
texture | texture of the sprite |
rectSource | rectangle source of the sprite |
rectDest | rectangle destination of the sprite |
origin | origin of the sprite |
rotation | rotation of the sprite |
scale | scale of the sprite |
Implements rtype::IGraphicalLib.
|
overridevirtual |
A method to draw a text.
text | text to draw |
pos | position of the text |
fontSize | size of the text |
color | color of the text |
Implements rtype::IGraphicalLib.
|
overridevirtual |
Stop drawing in the window.
Implements rtype::IGraphicalLib.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
A method to init the audio devide.
Implements rtype::IGraphicalLib.
|
overridevirtual |
A method to initialize a window object.
screenWidth | width of the window |
screenHeight | height of the window |
title | title of the window |
framerate | framerate of the window |
Implements rtype::IGraphicalLib.
|
overridevirtual |
|
overridevirtual |
A method to check if the left mouse button is pressed.
Implements rtype::IGraphicalLib.
|
overridevirtual |
A method to check if the left mouse button is released.
Implements rtype::IGraphicalLib.
|
overridevirtual |
Check if a key is not being pressed.
key |
Implements rtype::IGraphicalLib.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Play a sound with a multichannel buffer pool.
sound | Sound to play |
Implements rtype::IGraphicalLib.
|
overridevirtual |
|
overridevirtual |
Start drawing in the window.
Implements rtype::IGraphicalLib.
|
overridevirtual |
|
overridevirtual |