好吧,我承认3.4有点老了。如果该Bug,或者不算Bug在后续版本不存在,我十分乐意升级引擎。
先说问题:
代码A:
auto spriteTest = Sprite::create(“Img_Loading”); spriteTest->setPhysicsBody(PhysicsBody::createBox(Size(40, 10), PHYSICSSHAPE_MATERIAL_DEFAULT, Vec2(30, 0))); spriteTest->setPosition(500, 300); this->addChild(spriteTest); spriteTest->runAction(RepeatForever::create(RotateBy::create(2, 360))); ``` 效果A: 很正常对不对? 代码B:auto spriteTest = Sprite::create(“Img_Loading”); spriteTest->setPhysicsBody(PhysicsBody::createCircle(20, PHYSICSSHAPE_MATERIAL_DEFAULT, Vec2(30, 0))); spriteTest->setPosition(500, 300); this->addChild(spriteTest); spriteTest->runAction(RepeatForever::create(RotateBy::create(2, 360))); ``` 效果B: 我是想让PhysicsBody随Sprite一起运动的,但通过createCircle()创建的PhysicsBody不能随Sprite一同旋转,而Box就可以。 然后是查到一个setRotationEnable()方法。设置为true也没啥作用,当然我也不太清楚这个方法是否针对这种旋转。 坛子里的大神有何高见?
