Get the Root Node in hierarchy

Get the Root Node in hierarchy
0.0 0

#1

Hi,
How can I get the root node (Canvas in my case) in a best way?


Can I look for node set as canvas by simple code?
#2

var rootNode = cc.find(“Canvas”);


#3

Also

  1. let canvas = cc.game.canvas;
    Or
  2. let canvas = cc.director.getScene().getChildByName(“Canvas”);

1st way is most efficient out of all.