Aligning a sprite image to a GUI button boundaries

Started by Gal Shemesh, Thu 03/08/2023 11:07:37

Previous topic - Next topic

Gal Shemesh

Hi everyone,

Is there a way to align a sprite image of a button to either any of the sides / corners / center of a GUI button boundaries, the same as can be done for the text of a button?

I have a circled image button and I want that the hovering area of it will have padding in either direction, so it will be easier to hover and click on as the circle is only 26x26 pixels in size. It should also cover a text label below it which I want to highlight when the mouse cursor is hovering on the button.

Thanks
Gal Shemesh,
goldeng

Khris

You need to add padding to the sprite itself afaik. Either manually or in your script (by using a persistent dynamic sprite and drawing the actual sprite on its surface at the desired position).

Gal Shemesh

Mm... I see. Thought there might be a simple option for this in the editor as I wanted to use the same button sprite for different buttons, where each should cover a different area to serve as its hotspot. Anyway, thanks for your reply, @Khris! I ended up by making separated graphics for each button.
Gal Shemesh,
goldeng

SMF spam blocked by CleanTalk