Add a generic GuiButton class

If they were to add this, a better approach might be to add a button UIComponent in a similar vein to the recently added UIDragDetector.

That way you could parent the component to any gui object, and then connect the relevant events. It’s mainly a replacement for how many people use invisible text/image buttons under a frame, but without the unused text/image related features.

However, I don’t really see the need for such a feature at the moment, invisible text/image buttons don’t really have much performance impact.

2 Likes

For InputBegan/Ended/Changed, you can check the passed input object’s UserInputType to see if it was a mouse click.

I’ll admit having modal is pretty important and in quite a few situations would necessitate a blank Image/TextButton.

However, I still don’t think it’s such an inconvenience that requires GuiButton be made into a superclass we can instantiate.