Button clickable area (lack of) control

I have button sprites that have shadows on them (with alpha). The image for such a button sprite is much larger than the actual area that should be clickable.

I want to have better control for this clickable area instead of it just being the entire graphic element, but couldn’t find anything. A simple rect on the button script on top of the graphic element that controls the clickable area would solve it.

What I ended up doing is asking my artist to give me the clickable area and the shadows part separately, and combining it using an additional image object. This is a hacky way that can be easily avoided.

Thanks

While I agree more button area control would be nice, there is another way of going about this that can sort of make sense if you adapt your perspective a bit; namely, if you consider a Button to only mean “the clickable area”. What you would do then is use an Image where you now use a button, then add a Button child to that with a fully transparent color to handle the clicking. Note that this does require propagating any transitions and such, so you might just want to subclass Button and create an InteractableArea class or some such that propagates its events to its first child or something like that.

I guess that could work as well, but again this is another sort of hack. I think having stronger control over the clickable area makes sense.

its not a bad idea, we just hadn’t had time to implement it for v1.

Cool. It’s clearly not super urgent as there are simple workarounds for now, but it would be nice to see it down the road. I’m sure it’ll save people a lot of hassle.

Thanks.