Common/preferable way of node positioning

Hi,

I want to know which way of positioning a node is correct?

Method 1:

auto winSize = Director::getInstance()->getWinSize();
// node's positioning according to winSize...

Method 2:

auto visibleSize = Director::getInstance()->getVisibleSize();
auto origin = Director::getInstance()->getVisibleOrigin();
// node's positioning according to visibleSize + origin...

Or are they both correct?

Regards,
Mike.

The second one is always correct.

The first and the second one are different, if you are using the NO_BORDER policy.

1 Like

@iQD thanks for these clarifications.