PuzzleSDK
ParticleResetTotalParticles类 参考

#include <ParticleTest.h>

+ 类 ParticleResetTotalParticles 继承关系图:
+ ParticleResetTotalParticles 的协作图:

Public 成员函数

 CREATE_FUNC (ParticleResetTotalParticles)
 
virtual void onEnter () override
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 ParticleDemo
 ~ParticleDemo ()
 
void toggleCallback (cocos2d::Ref *sender)
 
void onTouchesBegan (const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
 
void onTouchesMoved (const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
 
void onTouchesEnded (const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
 
virtual void update (float dt) override
 
void setEmitterPosition ()
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual Type getTestType () const
 
virtual float getDuration () const
 
virtual std::string getExpectedOutput () const
 
virtual std::string getActualOutput () const
 
virtual void restartTestCallback (cocos2d::Ref *sender)
 
virtual void nextTestCallback (cocos2d::Ref *sender)
 
virtual void priorTestCallback (cocos2d::Ref *sender)
 
virtual void onBackCallback (cocos2d::Ref *sender)
 
void setTestSuite (TestSuite *testSuite)
 
TestSuitegetTestSuite () const
 
float getRunTime () const
 
void setTestCaseName (const std::string &name)
 
std::string getTestCaseName () const
 
const cocos2d::Label * getSubtitleLable () const
 
const cocos2d::MenuItemImage * getRestartTestItem () const
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 ParticleDemo
cocos2d::ParticleSystemQuad * _emitter
 
cocos2d::Sprite * _background
 
cocos2d::LayerColor * _color
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 ParticleTest.h390 行定义.

成员函数说明

◆ CREATE_FUNC()

ParticleResetTotalParticles::CREATE_FUNC ( ParticleResetTotalParticles  )

◆ onEnter()

void ParticleResetTotalParticles::onEnter ( )
overridevirtual

重载 ParticleDemo .

在文件 ParticleTest.cpp2012 行定义.

2013{
2015
2016 _color->setColor(Color3B::BLACK);
2017 removeChild(_background, true);
2018 _background = nullptr;
2019
2020 auto p = ParticleFire::createWithTotalParticles(10);
2021 this->addChild(p);
2022
2023 auto add = MenuItemFont::create("add 10 particles",
2024 [p](Ref*)->void
2025 {
2026 p->setTotalParticles(p->getTotalParticles() + 10 );
2027 });
2028 add->setFontSizeObj(20);
2029 add->setPosition(Vec2(0, 25));
2030
2031 auto remove = MenuItemFont::create("remove 10 particles",
2032 [p](Ref*)->void
2033 {
2034 int count = p->getTotalParticles() - 10;
2035 if (count < 0) { count = 0; }
2036 p->setTotalParticles(count);
2037 });
2038 remove->setPosition(Vec2(0, -25));
2039 remove->setFontSizeObj(20);
2040
2041 auto menu = Menu::create(add, remove, nullptr);
2042 menu->setPosition(Vec2(VisibleRect::center()));
2043 this->addChild(menu);
2044
2045}
cocos2d::Sprite * _background
Definition: ParticleTest.h:36
virtual void onEnter() override
cocos2d::LayerColor * _color
Definition: ParticleTest.h:37
static cocos2d::Vec2 center()
Definition: VisibleRect.cpp:69

引用了 ParticleDemo::_background, ParticleDemo::_color, VisibleRect::center() , 以及 ParticleDemo::onEnter().

+ 函数调用图:

◆ subtitle()

std::string ParticleResetTotalParticles::subtitle ( ) const
overridevirtual

重载 ParticleDemo .

在文件 ParticleTest.cpp2052 行定义.

2053{
2054 return "it should work as well";
2055}

◆ title()

std::string ParticleResetTotalParticles::title ( ) const
overridevirtual

重载 ParticleDemo .

在文件 ParticleTest.cpp2047 行定义.

2048{
2049 return "reset total particles";
2050}

该类的文档由以下文件生成: