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

Snap to all targets (Drag and drop game Animate CC HTML5 Canvas)

Explorer ,
Jul 17, 2022 Jul 17, 2022

Copy link to clipboard

Copied

Hi,

I created a drag and drop game in Animate CC with HTML5 canvas. How to make an object (red box) snaps to targets (white boxes)? It's not just snaps on correct target but also incorrect target, then shows response (correct or incorrect).

Best regard..

Noname.png

Views

239

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

correct answers 1 Correct answer

Community Expert , Jul 18, 2022 Jul 18, 2022

assuming all have the same center registration point and (target_mc is defined)

 

this.redbox.x = this.redbox.target_mc.x;

this.redbox.y = this.redbox.target_mc.y;

 

Votes

Translate

Translate
Community Expert ,
Jul 18, 2022 Jul 18, 2022

Copy link to clipboard

Copied

LATEST

assuming all have the same center registration point and (target_mc is defined)

 

this.redbox.x = this.redbox.target_mc.x;

this.redbox.y = this.redbox.target_mc.y;

 

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