Does anyone here know how you can draw an oval (if not, a circle at least) in prefab in Javascript?
So far, after creating a prefab, I added script so that it can draw a circle with it.
Here’s my code in that script:
cc.Class({
properties: {
nodeX:cc.DrawNode
},
onLoad () {
this.nodeX = new cc.DrawNode();
this.nodeX.drawCircle(cc.p(50,148), 150,cc.color.BLACK);
}
...
}
});
What am I doing wrong or what should I do instead?
Thanks in advance.