R-Type
Public Member Functions | List of all members
GameEngine::Sprite Class Reference

Class representing a sprite wrapper for sf::Sprite with additional functionality. More...

#include <SfmlTypes.hpp>

Inheritance diagram for GameEngine::Sprite:
GameEngine::ISprite< sf::Sprite, sf::Texture, sf::Rect >

Public Member Functions

 Sprite ()
 Default constructor for Sprite. More...
 
 ~Sprite ()=default
 Destructor for Sprite. More...
 
const sf::Sprite & getSprite () const override
 Returns the wrapped sf::Sprite. More...
 
void load (const ITexture< sf::Texture, sf::Rect > &texture, bool resetRect=false) override
 Loads the sprite with a specified texture and optional reset of the texture rectangle. More...
 
void setPosition (const Vector2< float > position) override
 Sets the position of the sprite. More...
 
void setTextureRect (const IRect< int, sf::Rect > &newRect) override
 Sets the texture rectangle of the sprite. More...
 
void setRect (const Recti &rect)
 Sets the texture rectangle of the sprite using a custom rectangle. More...
 
void setScale (const float &x, const float &y)
 
- Public Member Functions inherited from GameEngine::ISprite< sf::Sprite, sf::Texture, sf::Rect >
 ~ISprite ()=default
 Destructor. More...
 

Detailed Description

Class representing a sprite wrapper for sf::Sprite with additional functionality.

Constructor & Destructor Documentation

◆ Sprite()

GameEngine::Sprite::Sprite ( )
inline

Default constructor for Sprite.

◆ ~Sprite()

GameEngine::Sprite::~Sprite ( )
default

Destructor for Sprite.

Member Function Documentation

◆ getSprite()

const sf::Sprite& GameEngine::Sprite::getSprite ( ) const
inlineoverridevirtual

Returns the wrapped sf::Sprite.

Returns
Reference to the sf::Sprite instance

Implements GameEngine::ISprite< sf::Sprite, sf::Texture, sf::Rect >.

◆ load()

void GameEngine::Sprite::load ( const ITexture< sf::Texture, sf::Rect > &  texture,
bool  resetRect = false 
)
inlineoverridevirtual

Loads the sprite with a specified texture and optional reset of the texture rectangle.

Parameters
textureThe texture to apply to the sprite
resetRectFlag indicating whether to reset the texture rectangle

Implements GameEngine::ISprite< sf::Sprite, sf::Texture, sf::Rect >.

◆ setPosition()

void GameEngine::Sprite::setPosition ( const Vector2< float >  position)
inlineoverridevirtual

Sets the position of the sprite.

Parameters
positionThe new position of the sprite

Implements GameEngine::ISprite< sf::Sprite, sf::Texture, sf::Rect >.

◆ setRect()

void GameEngine::Sprite::setRect ( const Recti rect)
inline

Sets the texture rectangle of the sprite using a custom rectangle.

Parameters
rectThe custom rectangle defining the new texture rectangle

◆ setScale()

void GameEngine::Sprite::setScale ( const float &  x,
const float &  y 
)
inline

◆ setTextureRect()

void GameEngine::Sprite::setTextureRect ( const IRect< int, sf::Rect > &  newRect)
inlineoverridevirtual

Sets the texture rectangle of the sprite.

Parameters
newRectThe new texture rectangle to set

Implements GameEngine::ISprite< sf::Sprite, sf::Texture, sf::Rect >.


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