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

Can I look for node set as canvas by simple code?
0.0 0

#1

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

I’d like to call the custom component set as canvas here and there.
code of the current state is indicated on below.

It’s also troublesome to set it as a properties.
I’d like to conclude with code in 1 line.
Is there a way?


cc.Class({
extends: cc.Component,

properties: {

canvas: {
type: cc.Node,
default: null
},

},

// use this for initialization
onLoad: function () {

// 「load_point」is my customized component
cc.log(“point loaded:” + this._canvas.getComponent(“load_point”).load_local_point());

},


#2

See if this helps


#3

I’m moving with no problem.
thank you very much!