![]() |
Meteor2D
dev internal
Meteor is a lightweight 2D game engine.
|
Animation entity provides sprite - sheet based animation system to meteor. More...
#include <animation.h>

Public Member Functions | |
| MAnimation (std::string mapFile, int fps, ERenderLayer layer, uint8_t sortingOrder) | |
| Constructor for Animation. | |
| void | onUpdate (float deltaTime) override |
| void | setFPS (int fps) |
| set the frame-rate of the fps playback | |
| void | play (std::string name, bool looped) |
| Plays a specific animation. | |
| void | resume () |
| Resumes a stopped animation. | |
| void | stop () |
| Stops animation playback. | |
Public Member Functions inherited from meteor::MSpatialEntity | |
| MSpatialEntity () | |
| Default constructor, instantiates at root level. | |
| MSpatialEntity (MSpatialEntity *parent) | |
| Parameterised constructor. | |
| SVector2 | getPosition () |
| SVector2 | getLocalPosition () |
| void | setLocalPosition (float x, float y) |
| Sets local position of the entity. | |
| void | setLocalPosition (SVector2 pos) |
| Sets local position of the entity. | |
| float | getRotation () |
| float | getLocalRotation () |
| void | setLocalRotation (float localRotation) |
| Sets local rotation of the entity in x-axis. | |
| SVector2 | getLocalScale () |
| void | setLocalScale (float x, float y) |
| Sets local scale. | |
| void | setLocalScale (SVector2 scale) |
| brief Sets local scale | |
| MSpatialEntity * | getParent () |
| std::vector< MSpatialEntity * > * | getChildren () |
| void | addChild (MSpatialEntity *entity) |
| Adds a child to this entity. | |
| void | removeChild (MSpatialEntity *entity) |
| Remove a child from this entity. | |
| template<typename T > | |
| T * | find (std::string name) |
| Recursively searches for a SpatialEntity within this sub-tree. | |
| virtual void | onStart () |
| virtual void | onExit () |
Public Member Functions inherited from meteor::MEntity | |
| virtual bool | equals (MEntity *other) |
| Checks equality between two entities. | |
| std::string | getName () |
| void | setName (std::string name) |
| Sets name of entity. | |
| virtual std::string | toString () |
| Get this object as a string. | |
Additional Inherited Members | |
Protected Member Functions inherited from meteor::MSpatialEntity | |
| void | updatePositions () |
| void | updateRotations () |
| void | updateScale () |
| void | updateChildren (float deltaTime) |
Protected Attributes inherited from meteor::MSpatialEntity | |
| SVector2 | localPosition |
| SVector2 | localScale |
| SVector2 | position |
| float | rotation |
| float | localRotation |
| MSpatialEntity * | parent = NULL |
| std::vector< MSpatialEntity * > * | children = NULL |
Protected Attributes inherited from meteor::MEntity | |
| std::string | name |
Animation entity provides sprite - sheet based animation system to meteor.
| meteor::MAnimation::MAnimation | ( | std::string | mapFile, |
| int | fps, | ||
| ERenderLayer | layer, | ||
| uint8_t | sortingOrder ) |
Constructor for Animation.
| mapFile | relative path to the .anim file, will evaluate to resS\anim\<mapFile> |
| fps | the frame-rate of the animation playback. |
| layer | layer for rendering |
| sortingOrder | sorting order in render layer. |
|
overridevirtual |
Reimplemented from meteor::MSpatialEntity.
| void meteor::MAnimation::play | ( | std::string | name, |
| bool | looped ) |
Plays a specific animation.
| name | animation clip name |
| looped | set to true if the animation needs to be looping |
| void meteor::MAnimation::setFPS | ( | int | fps | ) |
set the frame-rate of the fps playback
| fps |