Image is too big for imagebutton

So I was doing some GUI for one of my games, and I was trying to make a simple shop button, and then ran into this.
image
Not sure if there is a property or something you can add to size the image correctly, but it really annoys me.

But anyway, if there is a solution please tell me!

You can change image size (out of roblox) to 1:1 or if thats the size you can use “Fit” in imagelabel properties scaletype then click “Fit” option (dont know if this helps)

Unfortunately, there is no property for scaling the image relative to the background. You can obviously upload it with padding, but that isn’t very flexible. Instead, it is common to have a blank button (no image/text) with a smaller, centered ImageLabel for the icon.

  • Remove image/text from button
  • Add ImageLabel and set properties:
    • Image
    • BackgroundTransparency = 1
    • AnchorPoint = 0.5, 0.5
    • Position = {0.5, 0}, {0.5, 0}
  • Scale accordingly (e.g., Size = {0.8, 0}, {0.8, 0} covers 80% of the button)

For buttons without square dimensions, you can use the SizeConstraint property of the label to maintain the icon’s aspect ratio.

1 Like

I would recommend you use a text button, set the text to “” then insert a image label inside of the text button and scale it to the size you want, and change the image.

Sorry to ask, but is there a way of fixing when selecting the textbutton, it selects the image and not the textbutton?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.