|
GameKit
0.0.1a
C++ gamedev tools
|
#include <Sprite.hpp>
Public Member Functions | |
| Sprite ()=default | |
| Sprite (const std::string &textureName, u16 frameWidth, u16 frameHeight, bool isAnimated=false) | |
| void | load (const Sprite &sprite) |
| void | load (const std::string &textureName, u16 frameWidth, u16 frameHeight, bool isAnimated=false) |
| void | updateAnimations () |
| void | addAnimation (const SpriteAnimation &animation) |
| u16 | currentFrame () const |
| u16 | frameWidth () const |
| u16 | frameHeight () const |
| bool | hasAnimations () |
| SpriteAnimation & | currentAnimation () |
| const SpriteAnimation & | currentAnimation () const |
| SpriteAnimation & | getAnimation (std::size_t i) |
| const SpriteAnimation & | getAnimation (std::size_t i) const |
| void | setCurrentFrame (u16 currentFrame) |
| void | setCurrentAnimation (u16 currentAnimation) |
| bool | isAnimated () const |
| void | setAnimated (bool isAnimated) |
Public Member Functions inherited from gk::Image | |
| Image ()=default | |
| Image (const std::string &textureName) | |
| Image (const Texture &texture) | |
| void | load (const Image &image) |
| void | load (const std::string &textureName) |
| void | load (const Texture &texture) |
| const FloatRect & | clipRect () const |
| void | setClipRect (float x, float y, u16 width, u16 height) |
| const FloatRect & | posRect () const |
| void | setPosRect (float x, float y, u16 width, u16 height) |
| u16 | width () const |
| u16 | height () const |
| void | setColor (const Color &color) |
| void | setAlphaMod (u8 alpha) |
| void | setFlip (bool isFlipped) |
Public Member Functions inherited from gk::IDrawable | |
| virtual | ~IDrawable ()=default |
| Virtual destructor. More... | |
Public Member Functions inherited from gk::Transformable | |
| virtual | ~Transformable ()=default |
| void | setPosition (float x, float y, float z=0) |
| void | setPosition (const Vector3f &position) |
| void | setOrigin (float x, float y, float z=0) |
| void | setOrigin (const Vector3f &origin) |
| void | setScale (float factorX, float factorY, float factorZ=1) |
| void | setScale (const Vector3f &factors) |
| void | setRotation (float angle) |
| void | setRotation (float angle, const Vector3f &axis) |
| const Vector3f & | getPosition () const |
| const Vector3f & | getOrigin () const |
| const Vector3f & | getScale () const |
| float | getRotation () const |
| void | move (float offsetX, float offsetY, float offsetZ=0) |
| void | move (const Vector3f &offset) |
| void | scale (float factorX, float factorY, float factorZ=1) |
| void | scale (const Vector3f &factor) |
| void | rotate (float angle) |
| void | rotate (float angle, const Vector3f &axis) |
| const Transform & | getTransform () const |
Private Attributes | |
| std::vector< SpriteAnimation > | m_animations |
| u16 | m_currentFrame = 0 |
| u16 | m_currentAnimation = 0 |
| u16 | m_previousAnimation = 0 |
| u16 | m_frameWidth = 0 |
| u16 | m_frameHeight = 0 |
| bool | m_isAnimated = false |
Additional Inherited Members | |
Protected Member Functions inherited from gk::Image | |
| void | updateVertexBuffer () const |
| void | draw (RenderTarget &target, RenderStates states) const override |
| Draw the object to a render target. More... | |
Protected Attributes inherited from gk::Image | |
| const Texture * | m_texture = nullptr |
| VertexBuffer | m_vbo |
Definition at line 22 of file Sprite.hpp.
|
default |
| gk::Sprite::Sprite | ( | const std::string & | textureName, |
| u16 | frameWidth, | ||
| u16 | frameHeight, | ||
| bool | isAnimated = false |
||
| ) |
Definition at line 19 of file Sprite.cpp.
|
inline |
Definition at line 32 of file Sprite.hpp.
|
inline |
Definition at line 41 of file Sprite.hpp.
|
inline |
Definition at line 42 of file Sprite.hpp.
|
inline |
Definition at line 34 of file Sprite.hpp.
|
inline |
Definition at line 37 of file Sprite.hpp.
|
inline |
Definition at line 36 of file Sprite.hpp.
|
inline |
Definition at line 44 of file Sprite.hpp.
|
inline |
Definition at line 45 of file Sprite.hpp.
|
inline |
Definition at line 39 of file Sprite.hpp.
|
inline |
Definition at line 50 of file Sprite.hpp.
| void gk::Sprite::load | ( | const Sprite & | sprite | ) |
Definition at line 23 of file Sprite.cpp.
| void gk::Sprite::load | ( | const std::string & | textureName, |
| u16 | frameWidth, | ||
| u16 | frameHeight, | ||
| bool | isAnimated = false |
||
| ) |
Definition at line 39 of file Sprite.cpp.
|
inline |
Definition at line 51 of file Sprite.hpp.
| void gk::Sprite::setCurrentAnimation | ( | u16 | currentAnimation | ) |
Definition at line 73 of file Sprite.cpp.
| void gk::Sprite::setCurrentFrame | ( | u16 | currentFrame | ) |
Definition at line 64 of file Sprite.cpp.
| void gk::Sprite::updateAnimations | ( | ) |
Definition at line 52 of file Sprite.cpp.
|
private |
Definition at line 54 of file Sprite.hpp.
|
private |
Definition at line 57 of file Sprite.hpp.
|
private |
Definition at line 56 of file Sprite.hpp.
|
private |
Definition at line 61 of file Sprite.hpp.
|
private |
Definition at line 60 of file Sprite.hpp.
|
private |
Definition at line 63 of file Sprite.hpp.
|
private |
Definition at line 58 of file Sprite.hpp.
1.8.12