2014-03-07 15:36:45 +08:00
|
|
|
//
|
|
|
|
// CustomParticleWidget.h
|
|
|
|
// CustomUI
|
|
|
|
//
|
|
|
|
// Created by cai wenzhi on 14-3-7.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef __CustomUI__CustomParticleWidget__
|
|
|
|
#define __CustomUI__CustomParticleWidget__
|
|
|
|
|
2014-03-11 17:13:54 +08:00
|
|
|
#include "ui/CocosGUI.h"
|
2014-03-07 15:36:45 +08:00
|
|
|
|
2014-06-04 14:26:21 +08:00
|
|
|
namespace cocos2d {
|
|
|
|
class ParticleSystem;
|
|
|
|
}
|
|
|
|
|
2014-03-07 15:36:45 +08:00
|
|
|
class CustomParticleWidget : public cocos2d::ui::Widget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
CustomParticleWidget();
|
|
|
|
~CustomParticleWidget();
|
|
|
|
|
|
|
|
static CustomParticleWidget* create();
|
|
|
|
static cocos2d::Ref* createInstance();
|
|
|
|
|
|
|
|
void setParticlePlist(const char* plist);
|
|
|
|
const char* getParticlePlist() const;
|
|
|
|
|
2014-05-15 01:07:09 +08:00
|
|
|
void setParticlePosition(const cocos2d::Vec2& pos);
|
|
|
|
const cocos2d::Vec2& getParticlePosition() const;
|
2014-03-07 15:36:45 +08:00
|
|
|
|
2014-03-12 10:07:55 +08:00
|
|
|
void playParticle();
|
|
|
|
|
|
|
|
void stopParticle();
|
|
|
|
|
2014-03-07 15:36:45 +08:00
|
|
|
protected:
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual bool init() override;
|
2014-03-07 15:36:45 +08:00
|
|
|
virtual void initRenderer();
|
|
|
|
|
|
|
|
virtual void removeAllChildren();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
cocos2d::ParticleSystem* _emitter;
|
|
|
|
const char* _emitterPlist;
|
2014-05-15 01:07:09 +08:00
|
|
|
cocos2d::Vec2 _emitterPostion;
|
2014-03-07 15:36:45 +08:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* defined(__CustomUI__CustomParticleWidget__) */
|