From 5bd4477d4cf413e90a6b9ef5c8991798a687a0ec Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 20 Nov 2018 08:35:18 +0800 Subject: =?UTF-8?q?*=E6=9B=B4=E6=96=B0sprite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/graphics/particles/je_particle_system.h | 28 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'src/libjin/graphics/particles/je_particle_system.h') diff --git a/src/libjin/graphics/particles/je_particle_system.h b/src/libjin/graphics/particles/je_particle_system.h index 8ee79ec..fb4b8c7 100644 --- a/src/libjin/graphics/particles/je_particle_system.h +++ b/src/libjin/graphics/particles/je_particle_system.h @@ -33,7 +33,7 @@ namespace JinEngine /// /// Particle emitter, handle all particles it emitts. /// - class ParticleSystem/* : public Game::GameObject*/ + class ParticleSystem { public: /// @@ -56,14 +56,29 @@ namespace JinEngine /// /// Render particle system. /// - void render(float x, float y, float sx = 1, float sy = 1, float r = 0, float ax = 0, float ay = 0); + void render(); /// /// Set sprite to render. /// /// @param sprite Sprite to render. /// - void setGraphic(const Graphic* graphic); + void setSprite(const Sprite* sprite); + + /// + /// Set particle system position. + /// + void setPosition(float x, float y); + + /// + /// Pause particle spawn. + /// + void pause(bool isPause); + + /// + /// Clear all particles. + /// + void clear(); private: @@ -71,6 +86,11 @@ namespace JinEngine ParticleSystem(); + /// + /// Particle system position. + /// + Math::Vector2 mPosition; + /// /// /// @@ -89,7 +109,7 @@ namespace JinEngine /// /// Sprite to be drawn. /// - const Graphic* mGraphic; + const Sprite* mSprite; /// /// Particle emitter. -- cgit v1.1-26-g67d0