class TextureDisplayer -
More...
#include <TextureDisplayer.hpp>
|
| | TextureDisplayer (const std::string &pathImage) |
| | Constructor. More...
|
| |
| sf::Sprite & | getSprite (unsigned index=0) |
| | Get a particular sprite. More...
|
| |
|
int | getWidth () |
| | Get the Width of the texture.
|
| |
|
int | getHeight () |
| | Get the Height of the texture.
|
| |
|
unsigned | getSize () |
| | Get the number of sprite in a TextureDisplayer.
|
| |
|
void | addSprite () |
| | Add a Sprite with the texture to the TextureDisplayer.
|
| |
| void | setSpritePosition (int index, int x, int y, int xOffset, int yOffset, std::array< int, 2 > hexSize) |
| | Set a particular Sprite Position. More...
|
| |
| void | setHudSpritePosition (float scale, int windowLength, int windowWidth, int rotation=0, int priorityCardIndex=0) |
| | Set the position of all the HUD (barbareWheel, ladder, techWheel, priorityCard, actionCard) considering the type of the HUD. More...
|
| |
| void | moveSpritePosition (int xOffset, int yOffset) |
| | Move the sprite Position. More...
|
| |
|
void | setImageType (HudTextureType imageType) |
| |
|
void | clearSprites () |
| | Delete all sprites.
|
| |
| void | drawTextureDisplayerSprite (std::shared_ptr< sf::RenderWindow > window) |
| | draw all the sprites of a TextureDisplayer More...
|
| |
◆ TextureDisplayer()
| TextureDisplayer::TextureDisplayer |
( |
const std::string & |
filename | ) |
|
Constructor.
Constructor of TextureDisplayer class
- Parameters
-
| filename | name of the png path |
◆ drawTextureDisplayerSprite()
| void TextureDisplayer::drawTextureDisplayerSprite |
( |
std::shared_ptr< sf::RenderWindow > |
window | ) |
|
draw all the sprites of a TextureDisplayer
- Parameters
-
| window | window where the sprites are displayed |
◆ getSprite()
| sf::Sprite & TextureDisplayer::getSprite |
( |
unsigned |
index = 0 | ) |
|
Get a particular sprite.
- Parameters
-
| index | is the position of the sprite in the textureDisplayer list of Sprite |
◆ moveSpritePosition()
| void TextureDisplayer::moveSpritePosition |
( |
int |
xOffset, |
|
|
int |
yOffset |
|
) |
| |
Move the sprite Position.
- Parameters
-
| xOffset | is the X offset of the map in the screen |
| yOffset | is the Y offset of the map in the screen |
◆ setHudSpritePosition()
| void TextureDisplayer::setHudSpritePosition |
( |
float |
scale, |
|
|
int |
windowLength, |
|
|
int |
windowWidth, |
|
|
int |
rotation = 0, |
|
|
int |
index = 0 |
|
) |
| |
Set the position of all the HUD (barbareWheel, ladder, techWheel, priorityCard, actionCard) considering the type of the HUD.
- Parameters
-
| scale | scale to set the size of the hud image(1 by default if the windowLength is 1600) |
| windowLength | window length (1600 by default) |
| windowWidth | window width (900 by default) |
| rotation | rotation of the image (0 by default), usefull for the techWheel |
| index | index of the priorityCard to set the x position of each priorityCard |
◆ setSpritePosition()
| void TextureDisplayer::setSpritePosition |
( |
int |
index, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
xOffset, |
|
|
int |
yOffset, |
|
|
std::array< int, 2 > |
hexSize |
|
) |
| |
Set a particular Sprite Position.
- Parameters
-
| index | is the index position of the sprite |
| x | is the X position of the sprite in the Map |
| y | is the Y position of the sprite in the Map |
| xOffset | is the X offset of the map in the screen |
| yOffset | is the Y offset of the map in the screen |
| hexSize | is the size of an hexagon, it is used to place element on the Map |
The documentation for this class was generated from the following files: