PuzzleSDK
ActionCardinalSplineStacked类 参考

#include <ActionsTest.h>

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

Public 成员函数

 CREATE_FUNC (ActionCardinalSplineStacked)
 
virtual ~ActionCardinalSplineStacked ()
 
virtual void onEnter () override
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 ActionsDemo
virtual void onExit () override
 
void centerSprites (unsigned int numberOfSprites)
 
void alignSpritesLeft (unsigned int numberOfSprites)
 
- 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 属性 继承自 ActionsDemo
cocos2d::Sprite * _grossini
 
cocos2d::Sprite * _tamara
 
cocos2d::Sprite * _kathia
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 ActionsTest.h448 行定义.

构造及析构函数说明

◆ ~ActionCardinalSplineStacked()

ActionCardinalSplineStacked::~ActionCardinalSplineStacked ( )
virtual

在文件 ActionsTest.cpp1719 行定义.

1720{
1721}

成员函数说明

◆ CREATE_FUNC()

ActionCardinalSplineStacked::CREATE_FUNC ( ActionCardinalSplineStacked  )

◆ onEnter()

void ActionCardinalSplineStacked::onEnter ( )
overridevirtual

重载 ActionsDemo .

在文件 ActionsTest.cpp1648 行定义.

1649{
1651
1652 this->centerSprites(2);
1653
1654 auto s = Director::getInstance()->getWinSize();
1655
1656 auto array = PointArray::create(20);
1657
1658 array->addControlPoint(Vec2(0.0f, 0.0f));
1659 array->addControlPoint(Vec2(s.width/2-30,0.0f));
1660 array->addControlPoint(Vec2(s.width/2-30,s.height-80.0f));
1661 array->addControlPoint(Vec2(0.0f, s.height-80.0f));
1662 array->addControlPoint(Vec2(0.0f, 0.0f));
1663
1664
1665 //
1666 // sprite 1 (By)
1667 //
1668 // Spline with no tension (tension==0)
1669 //
1670
1671 auto action = CardinalSplineBy::create(3, array, 0);
1672 auto reverse = action->reverse();
1673
1674 auto seq = Sequence::create(action, reverse, nullptr);
1675
1676 _tamara->setPosition(50,50);
1677 _tamara->runAction(seq);
1678
1679 _tamara->runAction(
1680 RepeatForever::create(
1681 Sequence::create(
1682 MoveBy::create(0.05f, Vec2(10.0f,0.0f)),
1683 MoveBy::create(0.05f, Vec2(-10.0f,0.0f)),
1684 nullptr)));
1685
1686 auto drawNode1 = DrawNode::create();
1687 drawNode1->setPosition(Vec2(50.0f,50.0f));
1688 drawNode1->drawCardinalSpline(array, 0, 100, Color4F(1.0f, 0.0f, 1.0f, 1.0f));
1689 this->addChild(drawNode1);
1690
1691 //
1692 // sprite 2 (By)
1693 //
1694 // Spline with high tension (tension==1)
1695 //
1696
1697 auto *action2 = CardinalSplineBy::create(3, array, 1);
1698 auto reverse2 = action2->reverse();
1699
1700 auto seq2 = Sequence::create(action2, reverse2, nullptr);
1701
1702 _kathia->setPosition(s.width/2,50);
1703
1704 _kathia->runAction(seq2);
1705
1706 _kathia->runAction(
1707 RepeatForever::create(
1708 Sequence::create(
1709 MoveBy::create(0.05f, Vec2(10.0f,0.0f)),
1710 MoveBy::create(0.05f, Vec2(-10.0f,0.0f)),
1711 nullptr)));
1712
1713 auto drawNode2 = DrawNode::create();
1714 drawNode2->setPosition(Vec2(s.width/2,50.0f));
1715 drawNode2->drawCardinalSpline(array, 1, 100, Color4F(0.0f, 0.0f, 1.0f, 1.0f));
1716 this->addChild(drawNode2);
1717}
void centerSprites(unsigned int numberOfSprites)
virtual void onEnter() override
cocos2d::Sprite * _tamara
Definition: ActionsTest.h:38
cocos2d::Sprite * _kathia
Definition: ActionsTest.h:39

引用了 ActionsDemo::_kathia, ActionsDemo::_tamara, ActionsDemo::centerSprites() , 以及 ActionsDemo::onEnter().

+ 函数调用图:

◆ subtitle()

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

重载 TestCase .

在文件 ActionsTest.cpp1728 行定义.

1729{
1730 return "CCMoveBy + CardinalSplineBy/To at the same time";
1731}

◆ title()

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

重载 ActionsDemo .

在文件 ActionsTest.cpp1723 行定义.

1724{
1725 return "Stacked MoveBy + CardinalSpline actions";
1726}

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