#include <InitSfml.hpp>
◆ InitSfml()
InitSfml::InitSfml |
( |
int |
widthWindow = 1920 , |
|
|
int |
heightWindow = 1080 , |
|
|
const std::string & |
nameWindow = "R-Type" |
|
) |
| |
It creates a window with the given width, height and name
- Parameters
-
widthWindow | The width of the window |
heightWindow | The height of the window |
nameWindow | The name of the window |
◆ ~InitSfml()
◆ clear()
◆ display()
void InitSfml::display |
( |
| ) |
|
◆ getAllFont()
std::map< std::string, std::shared_ptr< sf::Font > > InitSfml::getAllFont |
( |
| ) |
|
◆ getAllTexture()
std::map< std::string, std::shared_ptr< sf::Texture > > InitSfml::getAllTexture |
( |
| ) |
|
This function returns a map of all the textures that have been loaded into the game
- Returns
- A map of string and shared_ptr of sf::Texture
◆ getEvent()
sf::Event & InitSfml::getEvent |
( |
| ) |
|
It returns a reference to the event object
- Returns
- The event.
◆ getFont()
std::shared_ptr< sf::Font > InitSfml::getFont |
( |
std::string |
idFont | ) |
const |
◆ getHeightWindow()
int InitSfml::getHeightWindow |
( |
| ) |
|
Get the height of the window.
- Returns
- The height of the window.
◆ getTexture()
std::shared_ptr< sf::Texture > InitSfml::getTexture |
( |
std::string |
idTexture | ) |
const |
If the texture exists, return it, else return nullptr
- Parameters
-
idTexture | The id of the texture you want to get. |
- Returns
- A pointer to a texture.
◆ getWidthWindow()
int InitSfml::getWidthWindow |
( |
| ) |
|
Get the width of the window.
- Returns
- The width of the window.
◆ getWindow()
std::shared_ptr< sf::RenderWindow > InitSfml::getWindow |
( |
| ) |
|
This function returns a pointer to the window.
- Returns
- A pointer to a shared pointer to a RenderWindow object.
◆ setFont()
void InitSfml::setFont |
( |
std::string |
idFont, |
|
|
std::string |
namePath |
|
) |
| |
It loads a font from a file
- Parameters
-
namePath | The path to the font file. |
◆ setTexture()
void InitSfml::setTexture |
( |
std::string |
idTexture, |
|
|
std::string |
namePath |
|
) |
| |
It takes an id and a path to a texture, loads the texture from the path, and then adds it to the texture list
- Parameters
-
idTexture | The name of the texture. |
namePath | The path to the texture file. |
The documentation for this class was generated from the following files: