aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/graphics/je_sprite.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-21 21:12:42 +0800
committerchai <chaifix@163.com>2018-11-21 21:12:42 +0800
commit07022c42a925d4d0c23ab31f0e75883766ce773a (patch)
tree5aa5fc533534ab987c954a30fa11fc124c50a755 /src/libjin/graphics/je_sprite.h
parentf440f7fb52ca62715504e4a3c7076456de40f7b8 (diff)
*动画系统
Diffstat (limited to 'src/libjin/graphics/je_sprite.h')
-rw-r--r--src/libjin/graphics/je_sprite.h18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/libjin/graphics/je_sprite.h b/src/libjin/graphics/je_sprite.h
index 4050ed8..c7c5a8b 100644
--- a/src/libjin/graphics/je_sprite.h
+++ b/src/libjin/graphics/je_sprite.h
@@ -6,6 +6,7 @@
#include "je_color.h"
#include "je_graphic.h"
+#include "je_renderable.h"
namespace JinEngine
{
@@ -15,23 +16,10 @@ namespace JinEngine
///
/// A sprite is unit of rendering. Animation is based on sprite, but not texture or other graphic stuff.
///
- class Sprite
+ class Sprite : public IRenderable
{
public:
- enum Origin
- {
- TopLeft,
- TopCenter,
- TopRight,
- MiddleLeft,
- MiddleCenter,
- MiddleRight,
- BottomLeft,
- BottomCenter,
- BottomRight
- };
-
Sprite(const Graphic* graphic, const Math::Quad& quad, Origin origin);
Sprite(const Graphic* graphic, const Math::Quad& quad, float ox, float oy);
@@ -44,7 +32,7 @@ namespace JinEngine
Math::Vector2<int> getSize();
- void render(float x, float y, float sx, float sy, float r) const;
+ void render(float x, float y, float sx, float sy, float r) const override;
private: