Hi guys 
Consider this very simple code (functions are called once in the cocos2d-x hello world project init):
void HelloWorld::addNode()
{
auto visibleSize = Director::getInstance()->getVisibleSize();
auto n = Node::create();
n->setContentSize(visibleSize);
n->setAnchorPoint({0.5f, 0.5f});
n->setPosition(visibleSize * 0.5f); // center the node
addChild(n);
auto s = Sprite::create("HelloWorld.png");
s->setAnchorPoint(Vec2::ZERO);
n->addChild(s);
}
void HelloWorld::addLayer()
{
auto visibleSize = Director::getInstance()->getVisibleSize();
auto n = Layer::create();
n->setContentSize(visibleSize);
n->setAnchorPoint({0.5f, 0.5f});
n->setPosition(visibleSize * 0.5f); // center the layer
addChild(n);
auto s = Sprite::create("HelloWorld.png");
s->setAnchorPoint(Vec2::ZERO);
n->addChild(s);
}
Here the result:
I expected the layer position, being the layer a node, to be equal to the node one (the center of the scene)!
Am I missing something?


