------------------------------------------------------------------ NodeToWorld ------------------------------------------------------------------
| 451 | // |
| 452 | //------------------------------------------------------------------ |
| 453 | NodeToWorld::NodeToWorld() |
| 454 | { |
| 455 | // |
| 456 | // This code tests that nodeToParent works OK: |
| 457 | // - It tests different anchor Points |
| 458 | // - It tests different children anchor points |
| 459 | |
| 460 | auto back = Sprite::create(s_back3); |
| 461 | addChild(back, -10); |
| 462 | back->setAnchorPoint(Vec2(0, 0)); |
| 463 | auto backSize = back->getContentSize(); |
| 464 | |
| 465 | auto item = MenuItemImage::create(s_PlayNormal, s_PlaySelect); |
| 466 | auto menu = Menu::create(item, nullptr); |
| 467 | menu->alignItemsVertically(); |
| 468 | menu->setPosition(Vec2(backSize.width / 2, backSize.height / 2)); |
| 469 | back->addChild(menu); |
| 470 | |
| 471 | auto rot = RotateBy::create(5.0f, 360.0f); |
| 472 | auto fe = RepeatForever::create(rot); |
| 473 | item->runAction(fe); |
| 474 | |
| 475 | auto move = MoveBy::create(3.0f, Vec2(200.0f, 0.0f)); |
| 476 | auto move_back = move->reverse(); |
| 477 | auto seq = Sequence::create(move, move_back, nullptr); |
| 478 | auto fe2 = RepeatForever::create(seq); |
| 479 | back->runAction(fe2); |
| 480 | } |
| 481 | |
| 482 | std::string NodeToWorld::subtitle() const |
| 483 | { |
nothing calls this directly
no test coverage detected