PuzzleSDK
RotateWorldMainLayer类 参考

#include <RotateWorldTest.h>

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

Public 成员函数

virtual void onEnter () override
 

详细描述

在文件 RotateWorldTest.h55 行定义.

成员函数说明

◆ onEnter()

void RotateWorldMainLayer::onEnter ( )
overridevirtual

在文件 RotateWorldTest.cpp114 行定义.

115{
116 Layer::onEnter();
117
118 float x,y;
119
120 auto size = Director::getInstance()->getWinSize();
121 x = size.width;
122 y = size.height;
123
124 auto blue = LayerColor::create(Color4B(0,0,255,255));
125 auto red = LayerColor::create(Color4B(255,0,0,255));
126 auto green = LayerColor::create(Color4B(0,255,0,255));
127 auto white = LayerColor::create(Color4B(255,255,255,255));
128
129 blue->setScale(0.5f);
130 blue->setPosition(Vec2(-x/4,-y/4));
131 blue->addChild( SpriteLayer::create() );
132
133 red->setScale(0.5f);
134 red->setPosition(Vec2(x/4,-y/4));
135
136 green->setScale(0.5f);
137 green->setPosition(Vec2(-x/4,y/4));
138 green->addChild(TestLayer::create());
139
140 white->setScale(0.5f);
141 white->setPosition(Vec2(x/4,y/4));
142 white->setIgnoreAnchorPointForPosition(false);
143 white->setPosition(Vec2(x/4*3,y/4*3));
144
145 addChild(blue, -1);
146 addChild(white);
147 addChild(green);
148 addChild(red);
149
150 auto rot = RotateBy::create(8, 720);
151
152 blue->runAction(rot);
153 red->runAction(rot->clone());
154 green->runAction(rot->clone());
155 white->runAction(rot->clone());
156}

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