参考了组件http://docs.cocos.com/creator/manual/zh/render/graphics/rect.html
我建了一个脚本game.js,绑定canvas
然后在onload方法里面
var ctx = this.getComponent(cc.Graphics);
ctx.rect(20,20,150,100);
ctx.stroke();
一直提示 错误
Uncaught TypeError: Cannot read property ‘rect’ of null
请问应该怎么改呢