GUI Button MouseOverGraphic bug?

Started by NiksterG, Wed 29/06/2011 17:42:22

Previous topic - Next topic

NiksterG

Hey all,

I just found something a little weird, and I thought I should ask here to make sure I'm doing everything correctly.

I'm trying to have a GUI that pops up when the user right clicks an inventory item. There are four buttons on the GUI, each of which does some inventory management action.

What I want to happen is for the buttons to display a border around a section of the background image when the mouse hovers over them. The button should have no image (image 0) at all other times. Naturally, I am trying to use the MouseOverGraphic property that all Buttons have.

However, I've noticed that the setting the NormalGraphic to 0 causes the button to act like it's half invisible - you can still click it and it still functions correctly, you just can't see it. You also can't see the MouseOverGraphic. I've tested specific values in game with the Display command; though the button images don't appear, the MouseOverGraphic reads as the one I set, and the button also reads as Visible. I'm just wondering if this is normal behavior, or if it's a bug.

In any case, I have a workaround - I just set the NormalGraphic to a single transparent pixel, and then set the MouseOverGraphic as normal. I'd still like to figure out this weird problem, though.
Check out my games! (Not all made with AGS)

Khris

Not sure if this classifies as a bug as opposed to a feature.

A button usually has either a picture or text on it (or both).
If you set an Image, you can optionally also have text.
If you don't want to use an image, AGS draws its standard grey plain button which doesn't have or use a mouse over image, but only if you have button text (which makes sense since AGS logically assumes that a button without image is going to use at least text).
It seems if you remove all text, AGS sticks to its "text button without mouseover optics" mode, probably assuming that this textual button is currently disabled or something, thus not showing anything instead of a grey button without any text on it.

So yeah, in order to get to what you describe (the button being there but not visibly), I have to set the picture sprite slot to 0 and remove its text. Which sort of defeats the whole point of having a button in the first place.

I guess the optical part of the button is provided by the GUI background?

Still, I can't see this as a bug because you're sort of intentionally breaking the concept of a GUI button.

SMF spam blocked by CleanTalk