1 Replies - 2888 Views - Last Post: 30 October 2013 - 08:17 AM

#1 APDamien  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 06-October 13

What is the clickable area on a Sprite

Posted 06 October 2013 - 10:36 AM

I want to build something that behaves like a button (clickable, changes appearance when hovered over or "pressed"). Unlike the standard buttons, I want it to be a circle (e.g., a large dot on a drawing of a map).

If I draw a circle in a Sprite, what will be the "active" (clickable) area? Is it the whole sprite, or only the part where I've drawn something? I'd prefer the latter -- what you see is what is clickable.

I notice that the SimpleButton class has a separate thing that describes what parts are active -- the "HitTest" image. Can I do this if I use a Sprite instead?

Is This A Good Question/Topic? 0
  • +

Replies To: What is the clickable area on a Sprite

#2 lordofduct  Icon User is offline

  • I'm a cheeseburger
  • member icon


Reputation: 2506
  • View blog
  • Posts: 4,615
  • Joined: 24-September 10

Re: What is the clickable area on a Sprite

Posted 30 October 2013 - 08:17 AM

Clickable area will be any area filled with actual graphic.

So yeah, if you draw a circle, then only the circle is clickable.




If you happen to want the prior ever in the future, what I usually would do is do a rectangle (or what ever shape) fill of transparent color on the graphics layer. Transparent filled graphics are still see through, but create an actively clickable area.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1