Turbo Engine 0.3
A C++ game engine using Allegro 5
turbo::Sprite Class Reference

Represent a drawable sprite. More...

#include <Sprite.hpp>

Inheritance diagram for turbo::Sprite:
Collaboration diagram for turbo::Sprite:

Public Member Functions

 Sprite (Texture *texture)
void draw () const override
 Draw the drawable -_-.
unsigned int get_width () const
 Get the width of the sprite.
unsigned int get_height () const
 Get the height of the sprite.
Textureget_texture () const
 Get the source texture (not owned by the sprite).

Public Attributes

Rectangle rect = Rectangle<>()
 Target texture region.

Protected Attributes

Texturetexture
 Target texture.

Detailed Description

Represent a drawable sprite.

Constructor & Destructor Documentation

◆ Sprite()

turbo::Sprite::Sprite ( Texture * texture)

Member Function Documentation

◆ draw()

void turbo::Sprite::draw ( ) const
overridevirtual

Draw the drawable -_-.

Implements turbo::Drawable.

◆ get_height()

unsigned int turbo::Sprite::get_height ( ) const

Get the height of the sprite.

Returns
unsigned int height

◆ get_texture()

Texture * turbo::Sprite::get_texture ( ) const
inline

Get the source texture (not owned by the sprite).

◆ get_width()

unsigned int turbo::Sprite::get_width ( ) const

Get the width of the sprite.

Returns
unsigned int width

Member Data Documentation

◆ rect

Rectangle turbo::Sprite::rect = Rectangle<>()

Target texture region.

◆ texture

Texture* turbo::Sprite::texture
protected

Target texture.


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