Sprite object for displaying images.
More...
#include <Objects.hpp>
|
|
| ~Sprite () |
| | Destructor.
|
| |
| virtual void | Update (Scene::Scene *scene) override |
| | Update and draw the sprite.
|
| |
| double | getAngle () |
| | Get the current rotation angle.
|
| |
| void | SetAngle (double new_angle) |
| | Set the rotation angle.
|
| |
| void | AddAngle (double add_angle) |
| | Add to the current rotation angle.
|
| |
| bool | LoadFromFile (const char *path) |
| | Load a sprite from a file.
|
| |
| void | SetFrame (int index) |
| | Set the current frame of the sprite.
|
| |
| double | get_x () |
| | Get the X position.
|
| |
| void | SetX (double new_x) |
| | Set the X position.
|
| |
| void | AddX (double add_x) |
| | Add to the X position.
|
| |
| double | get_y () |
| | Get the Y position.
|
| |
| void | SetY (double new_y) |
| | Set the Y position.
|
| |
| void | AddY (double add_y) |
| | Add to the Y position.
|
| |
|
virtual void | Init () |
| | Initialize the object.
|
| |
|
void | UpdateAttached () |
| | Updates the objects attached to this instance.
|
| |
| void | Attach (Object *obj) |
| | Attach an object to this object and set its relative position.
|
| |
| void | SetScene (Scene::Scene *scene) |
| | Setter for the currentscene (called by the Scene instance)
|
| |
| Scene::Scene * | GetScene () const |
| | Getter for the currentscene (called by the Scene instance)
|
| |
| void | SetInputManager (Input::InputManager *manager) |
| | Setter for the inputmanager (called by the Scene instance)
|
| |
|
|
float | width = 0 |
| | Width of the sprite.
|
| |
|
float | height = 0 |
| | Height of the sprite.
|
| |
|
bool | visible = true |
| |
|
std::vector< Objects::Object * > | attachedElements |
| |
|
Object * | parent = nullptr |
| |
|
int | id = -1 |
| |
Sprite object for displaying images.
◆ AddAngle()
| void Sprite::AddAngle |
( |
double | add_angle | ) |
|
Add to the current rotation angle.
- Parameters
-
| add_angle | Angle to add in degrees |
◆ getAngle()
| double Sprite::getAngle |
( |
| ) |
|
Get the current rotation angle.
- Returns
- Current angle in degrees
◆ LoadFromFile()
| bool Sprite::LoadFromFile |
( |
const char * | path | ) |
|
Load a sprite from a file.
- Parameters
-
| path | Path to the image file |
- Returns
- true if loading succeeded, false otherwise
◆ SetAngle()
| void Sprite::SetAngle |
( |
double | new_angle | ) |
|
Set the rotation angle.
- Parameters
-
| new_angle | New angle in degrees |
◆ SetFrame()
| void Sprite::SetFrame |
( |
int | index | ) |
|
Set the current frame of the sprite.
- Parameters
-
| index | Index of the frame to display |
◆ Update()
Update and draw the sprite.
- Parameters
-
| scene | Pointer to the current scene |
Reimplemented from Objects::Object.
The documentation for this class was generated from the following files: