• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

121

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
Community Expert ,
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);

Votes

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