Copy link to clipboard
Copied
Evening everyone.
Small question: in html canvas, is it possible to fix beginStroke canvas starting coordinates to a symbol or object or something else. Say I create an object in adobe, a small circle- in javascript I would like to tie the graphical beginStroke coordinate to that circle coordinate. If I move that circle around, the javascript graphic will move with it.
Copy link to clipboard
Copied
sure.
just add (using addChild) your shape to your small circle. eg, if your circle has instance name circle0, you can use:
var g = new createjs.Graphics();
g.beginFill(createjs.Graphics.getRGB(255,0,0));
g.drawCircle(0,0,20);
g.endFill();
var s = new createjs.Shape(g);
this.circle0.addChild(s);