diff options
Diffstat (limited to 'sprite.cpp')
-rw-r--r-- | sprite.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1,8 +1,15 @@ #include "sprite.h" -Sprite::Sprite(const unsigned char *image,unsigned int image_len) - :image(image),image_len(image_len){ +Sprite::Sprite(const unsigned char *image,unsigned int image_len){ sf_texture.loadFromMemory(image,image_len); sf_sprite.setTexture(sf_texture); } + +int Sprite::width() const { + return sf_texture.getSize().x; +} + +int Sprite::height() const { + return sf_texture.getSize().y; +} |