MCPcopy Create free account
hub / github.com/axmolengine/axmol / NodeToWorld

Method NodeToWorld

tests/cpp-tests/Source/NodeTest/NodeTest.cpp:453–480  ·  view source on GitHub ↗

------------------------------------------------------------------ NodeToWorld ------------------------------------------------------------------

Source from the content-addressed store, hash-verified

451//
452//------------------------------------------------------------------
453NodeToWorld::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
482std::string NodeToWorld::subtitle() const
483{

Callers

nothing calls this directly

Calls 9

createFunction · 0.85
alignItemsVerticallyMethod · 0.80
Vec2Function · 0.50
setAnchorPointMethod · 0.45
getContentSizeMethod · 0.45
setPositionMethod · 0.45
addChildMethod · 0.45
runActionMethod · 0.45
reverseMethod · 0.45

Tested by

no test coverage detected