dEngine
Simple 2D C++ game engine
|
A sprite. More...
#include <Sprite.h>
Public Member Functions | |
Sprite (std::string filepath, GameObject &parent) | |
Constructor. More... | |
~Sprite () | |
Desctructor. More... | |
void | Render () override |
Render Function. More... | |
SDL_Texture * | getTexture () |
Sprite Texture. More... | |
![]() | |
Component (GameObject &parent) | |
Create a new component for a gameobject. More... | |
virtual void | NotifyCollision (GameObject &other) |
std::string | GetName () |
Returns the component's name. More... | |
virtual void | Start () |
Start the object To be called by the GameObject's Start method. This should be called at the beginning of instantiation. More... | |
virtual void | Update () |
Private Attributes | |
SDL_Texture * | texture |
Additional Inherited Members | |
![]() | |
GameObject & | parent |
std::string | name |
A sprite.
Sprites are used for static images that don't require animation
Sprite::Sprite | ( | std::string | filepath, |
GameObject & | parent | ||
) |
Constructor.
Creates a sprite from the image defined in the filepath
Sprite::~Sprite | ( | ) |
Desctructor.
Frees up resources allocated by Sprite
SDL_Texture * Sprite::getTexture | ( | ) |
Sprite Texture.
Returns a pointer to the texture
|
overridevirtual |
|
private |
Referenced by getTexture(), Render(), Sprite(), and ~Sprite().