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

How do I make a button work in a specific area on the canvas only?

New Here ,
Feb 03, 2014 Feb 03, 2014

I'm making a Minecraft-Terraria style mining game, and I have a pickaxe tool. I want to make it so it can only be triggered over a certain area or position. How would I do this?

PS. If it uses coordinates, how would I find those?

TOPICS
ActionScript
461
Translate
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 ,
Feb 03, 2014 Feb 03, 2014

you can use a hitTest with a shape that you place on the stage or using coordinates.  if you use coordinates, you would use the pickaxe._x and pickaxe._y values.

Translate
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
New Here ,
Feb 05, 2014 Feb 05, 2014

Sounds good, do you have any idea how I would do that? 😕 I'm a bit confused.

Translate
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 ,
Feb 05, 2014 Feb 05, 2014
LATEST

which one?

there are 2 different suggestions.  using coordinates is easiest to use but only works well if the area is rectangular.

Translate
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