Fix canvas coordinate starting point to symbol

New Here ,
Mar 21, 2021 Mar 21, 2021

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.

Views

36

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 21, 2021 Mar 21, 2021

Copy link to clipboard

Copied

LATEST

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);

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines