Hi,
How can I get the root node (Canvas in my case) in a best way?
var rootNode = cc.find(“Canvas”);
Also
- let canvas = cc.game.canvas;
Or - let canvas = cc.director.getScene().getChildByName(“Canvas”);
1st way is most efficient out of all.
Hi,
How can I get the root node (Canvas in my case) in a best way?
var rootNode = cc.find(“Canvas”);
Also
1st way is most efficient out of all.