Game Develop C++ Platform: Direction Class Reference

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Member Functions | List of all members
Direction Class Reference
Built-in Sprite Object extension

Class defining a direction of an Animation. More...

`#include <Direction.h>`

## Public Member Functions

bool | IsLooping () const
void | SetLoop (bool loop_)
float | GetTimeBetweenFrames () const
void | SetTimeBetweenFrames (float time)
const Sprite & | GetSprite (unsigned int nb) const
Sprite & | GetSprite (unsigned int nb)
bool | HasNoSprites () const
unsigned int | GetSpriteCount () const
void | RemoveSprite (unsigned int index)
void | RemoveAllSprites ()
void | AddSprite (const Sprite &sprite)
void | SwapSprites (unsigned int firstSpriteIndex, unsigned int secondSpriteIndex)
void | LoadFromXml (const TiXmlElement *element)

## Detailed Description

Class defining a direction of an Animation.

See Also
  SpriteObject
  Animation
  Sprite

## Member Function Documentation

void Direction::AddSprite | ( | const Sprite & | sprite) |  |

Add a new sprite at the end of the list.

const Sprite & Direction::GetSprite | ( | unsigned int | nb) |  | const

Return a reference to a sprite of the direction.

Parameters

  nb | The index of the sprite to be accessed. Bound checking is not made.

Returns
  A reference to the sprite.

Sprite & Direction::GetSprite | ( | unsigned int | nb) |  |

Return a reference to a sprite of the direction.

Parameters

  nb | The index of the sprite to be accessed. Bound checking is not made.

Returns
  A reference to the sprite.

unsigned int Direction::GetSpriteCount | ( | ) |  | const

inline

Return the number of sprite used in the direction

Returns
  The number of sprite used in the direction

float Direction::GetTimeBetweenFrames | ( | ) |  | const

inline

Get the time between each sprite

bool Direction::HasNoSprites | ( | ) |  | const

inline

Check if the direction contains sprites.

Returns
  true if the direction does not have any sprite.

bool Direction::IsLooping | ( | ) |  | const

inline

Return true if sprites looping is activated

void Direction::RemoveAllSprites | ( | ) |  |

inline

Clear the direction from all of its sprites

void Direction::RemoveSprite | ( | unsigned int | index) |  |

Remove the sprite at the specified position. Bound-checking is made.

void Direction::SetLoop | ( | bool | loop_) |  |

Set if the sprites must be looping or not.

void Direction::SetTimeBetweenFrames | ( | float | time) |  |

Set the time between each sprite

Parameters

  time | Time between each sprite, in seconds.

void Direction::SwapSprites | ( | unsigned int | firstSpriteIndex,
|  | unsigned int | secondSpriteIndex
| ) |  |

Swap the position of two sprites

The documentation for this class was generated from the following files:

- Direction.h
- Direction.cpp