![]() |
GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
|
Class defining a direction (set of frames) of an Animation. More...
#include <Direction.h>
Public Member Functions | |
| bool | IsLooping () const |
| Return true if sprites looping is activated. | |
| void | SetLoop (bool loop_) |
| Set if the sprites must be looping or not. | |
| double | GetTimeBetweenFrames () const |
| Get the time between each sprite. | |
| void | SetTimeBetweenFrames (double time) |
| Set the time between each sprite. More... | |
| const Sprite & | GetSprite (std::size_t nb) const |
| Return a reference to a sprite of the direction. More... | |
| Sprite & | GetSprite (std::size_t nb) |
| Return a reference to a sprite of the direction. More... | |
| const std::vector< gd::String > & | GetSpriteNames () const |
| Return a vector of references to sprite names. More... | |
| bool | HasNoSprites () const |
| Check if the direction contains sprites. More... | |
| std::size_t | GetSpritesCount () const |
| Return the number of sprite used in the direction. More... | |
| void | RemoveSprite (std::size_t index) |
| Remove the sprite at the specified position. More... | |
| void | RemoveAllSprites () |
| Clear the direction from all of its sprites. | |
| void | AddSprite (const Sprite &sprite) |
| Add a new sprite at the end of the list. | |
| void | SwapSprites (std::size_t firstSpriteIndex, std::size_t secondSpriteIndex) |
| Swap the position of two sprites. | |
| void | MoveSprite (std::size_t oldIndex, std::size_t newIndex) |
| Change the position of the specified sprite. | |
| virtual void | SetMetadata (const gd::String &metadata_) |
| Set the metadata (any string) associated to the Direction. More... | |
| virtual const gd::String & | GetMetadata () const |
| Return the (optional) metadata associated to the Direction. | |
| void | UnserializeFrom (const gd::SerializerElement &element) |
| void | SerializeTo (gd::SerializerElement &element) const |
Class defining a direction (set of frames) of an Animation.
| Sprite & gd::Direction::GetSprite | ( | std::size_t | nb | ) |
Return a reference to a sprite of the direction.
| nb | The index of the sprite to be accessed. Bound checking is not made. |
| const Sprite & gd::Direction::GetSprite | ( | std::size_t | nb | ) | const |
Return a reference to a sprite of the direction.
| nb | The index of the sprite to be accessed. Bound checking is not made. |
| const std::vector< gd::String > & gd::Direction::GetSpriteNames | ( | ) | const |
Return a vector of references to sprite names.
| std::size_t gd::Direction::GetSpritesCount | ( | ) | const |
Return the number of sprite used in the direction.
| bool gd::Direction::HasNoSprites | ( | ) | const |
Check if the direction contains sprites.
| void gd::Direction::RemoveSprite | ( | std::size_t | index | ) |
Remove the sprite at the specified position.
Bound-checking is made.
|
inlinevirtual |
Set the metadata (any string) associated to the Direction.
| void gd::Direction::SetTimeBetweenFrames | ( | double | time | ) |
Set the time between each sprite.
| time | Time between each sprite, in seconds. |