Корабът Радецки - Eight ball pool v 1.0
The documnetation for our physics-themed project.
Sprite Class Reference

#include <sprite.hpp>

Inheritance diagram for Sprite:
DrawableManager::Drawable Ball Stick Table

Public Member Functions

 Sprite (const char *texture_file_name, Vector2 initial_position, float scale=1.0f, float rotation=0.0f)
 
virtual ~Sprite ()
 
void SetScale (float scale)
 Sets the scale of the sprites. More...
 
void SetPosition (Vector2 position)
 Sets the position of the sprites. More...
 
void SetRotation (float rotation)
 Sets the rotation of the sprites. More...
 
Vector2 GetPosition ()
 Gets the position of the sprites. More...
 
float GetWidth ()
 Gets the width of the sprites. More...
 
float GetHeight ()
 Gets the height of the sprites. More...
 
float GetRotation ()
 Gets the exact rotation of the sprites. More...
 
void Draw () override
 Draws the sprites. More...
 
- Public Member Functions inherited from DrawableManager::Drawable
 Drawable ()
 Sets the sprites' IDs. More...
 
virtual ~Drawable ()=default
 
virtual void Create ()
 
virtual void Update ()
 
int GetID ()
 

Protected Attributes

Vector2 sprite_position
 
Texture2D sprite_texture
 
float sprite_scale_factor
 
float sprite_rotation
 

Constructor & Destructor Documentation

◆ Sprite()

Sprite::Sprite ( const char *  texture_file_name,
Vector2  initial_position,
float  scale = 1.0f,
float  rotation = 0.0f 
)
inline

◆ ~Sprite()

virtual Sprite::~Sprite ( )
inlinevirtual

Member Function Documentation

◆ Draw()

void Sprite::Draw ( )
overridevirtual

Draws the sprites.

Reimplemented from DrawableManager::Drawable.

Reimplemented in Ball, and Stick.

◆ GetHeight()

float Sprite::GetHeight ( )

Gets the height of the sprites.

Returns
float This returns the height of all the sprites

◆ GetPosition()

Vector2 Sprite::GetPosition ( )

Gets the position of the sprites.

Returns
Vector2 This returns the exact position of the various sprites

◆ GetRotation()

float Sprite::GetRotation ( )

Gets the exact rotation of the sprites.

Returns
float This returns the exact rotation of the sprites

◆ GetWidth()

float Sprite::GetWidth ( )

Gets the width of the sprites.

Returns
float This returns the width of all the sprites

◆ SetPosition()

void Sprite::SetPosition ( Vector2  position)

Sets the position of the sprites.

Parameters
positionThis describes the exact position of every sprite

◆ SetRotation()

void Sprite::SetRotation ( float  rotation)

Sets the rotation of the sprites.

Parameters
rotationThis describes the exact rotation of the pool cue

◆ SetScale()

void Sprite::SetScale ( float  scale)

Sets the scale of the sprites.

Parameters
scaleThis describes the scale factor

Member Data Documentation

◆ sprite_position

Vector2 Sprite::sprite_position
protected

◆ sprite_rotation

float Sprite::sprite_rotation
protected

◆ sprite_scale_factor

float Sprite::sprite_scale_factor
protected

◆ sprite_texture

Texture2D Sprite::sprite_texture
protected