Creates an Entity object. More...
#include <Entity.h>
Public Member Functions | |
JAM_Entity (JAM_Texture *sprite, float x, float y, float width, float height) | |
~JAM_Entity () | |
virtual void | update (float dt)=0 |
void | draw (SDL_Renderer *renderer) |
void | setPosition (float x, float y) |
void | setPosition (JAM_Vec2 position) |
void | setX (float x) |
void | setY (float y) |
void | setDimensions (float width, float height) |
void | setDimensions (JAM_Vec2 dimensions) |
void | setWidth (float width) |
void | setHeight (float height) |
JAM_Vec2 | getPosition () |
JAM_Vec2 | getDimensions () |
Private Attributes | |
JAM_Texture * | sprite |
JAM_Vec2 | position |
JAM_Vec2 | dimensions |
Creates an Entity object.
JAM_Entity::JAM_Entity | ( | JAM_Texture * | sprite, |
float | x, | ||
float | y, | ||
float | width, | ||
float | height | ||
) |
Constructs the Entity object.
sprite | A pointer to the objects Texture. |
x | The x position of the Entity. |
y | The y position of the Entity. |
width | The width of the Entity. |
height | The height of the Entity. |
JAM_Entity::~JAM_Entity | ( | ) |
Destructs the Entity object.
void JAM_Entity::draw | ( | SDL_Renderer * | renderer | ) |
Draws the Entity to the screen.
renderer | A pointer to the SDL renderer. |
JAM_Vec2 JAM_Entity::getDimensions | ( | ) |
Getter # Gets the dimensions of the Entity.
JAM_Vec2 JAM_Entity::getPosition | ( | ) |
Getter # Gets the position of the Entity.
void JAM_Entity::setDimensions | ( | float | width, |
float | height | ||
) |
Setter # Sets the dimensions of the Entity.
width | The new width of the Entity. |
height | The new height of the Entity. |
void JAM_Entity::setDimensions | ( | JAM_Vec2 | dimensions | ) |
Setter # Sets the dimensions of the Entity.
dimensions | The new dimensions of the Entity. |
void JAM_Entity::setHeight | ( | float | height | ) |
Setter # Sets the height of the Entity.
height | The new height of the Entity. |
void JAM_Entity::setPosition | ( | float | x, |
float | y | ||
) |
Setter # Sets the position of the Entity.
x | The new x position of the Entity. |
y | The new y position of the Entity. |
void JAM_Entity::setPosition | ( | JAM_Vec2 | position | ) |
Setter # Sets the position of the Entity.
position | The new position of the Entity. |
void JAM_Entity::setWidth | ( | float | width | ) |
Setter # Sets the width of the Entity.
width | The new width of the Entity. |
void JAM_Entity::setX | ( | float | x | ) |
Setter # Sets the x position of the Entity.
x | The x position of the Entity. |
void JAM_Entity::setY | ( | float | y | ) |
Setter # Sets the y position of the Entity.
y | The y position of the Entity. |
|
pure virtual |
A pure virtual function that updates the Entity.
dt | The delta time. |
Implemented in JAM_Button, MapSquare, and Robot.
|
private |
The dimensions of the Entity.
|
private |
The position of the Entity.
|
private |
A pointer to the objects Texture.