Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Gal Shemesh on Thu 03/08/2023 11:07:37

Title: Aligning a sprite image to a GUI button boundaries
Post by: Gal Shemesh on Thu 03/08/2023 11:07:37
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
Title: Re: Aligning a sprite image to a GUI button boundaries
Post by: Khris on Thu 03/08/2023 14:16:00
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).
Title: Re: Aligning a sprite image to a GUI button boundaries
Post by: Gal Shemesh on Fri 04/08/2023 10:30:01
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.