Suggestion: Button.DisabledGraphic

Started by GarageGothic, Mon 07/02/2005 11:36:12

Previous topic - Next topic

GarageGothic

We have Normal, MouseOver and Pushed graphics, but it would be really nice if you could also set a DisabledGraphic for GUI buttons.  The "greying out" doesn't always look good on custom-made button graphics.

I've looked in the tracker but couldn't find anything related to this. Thanks for reading this suggestion.

Radiant

As a workaround,
Code: ags

function DisableButton (int gui, int button, int graphic) {
  SetButtonDisabled (gui, button);
  SetButtonGraphic (gui, button, graphic);
}


or something like that, anyway.

GarageGothic

Yeah, you're right. That is a good workaround. Of course this means that you need to have graphics for all disabled buttons  :-\ But thanks for the suggestion, I'll probably do just that.

Pumaman

It's a reasonable suggestion for a future version; would anyone else find it useful?

Redwall

Quote from: GarageGothic on Mon 07/02/2005 11:53:01
Yeah, you're right. That is a good workaround. Of course this means that you need to have graphics for all disabled buttons :-\ But thanks for the suggestion, I'll probably do just that.

You could just pass the original graphic if it doesn't have one, couldn't you?
aka Nur-ab-sal

"Fixed is not unbroken."

Radiant

Quote from: Pumaman on Mon 07/02/2005 20:42:28
It's a reasonable suggestion for a future version; would anyone else find it useful?

Maybe. What I'd find more useful would be if disabled buttons (if grayed out as per that option) were grayened with alpha blending (or maybe just 30% transparency or 30% luminescence, you get the general idea) rather than pixel shading. The latter looks a bit weird in 320x200.

strazer

#6
Yeah, I'm also not fond the gray pixel pattern.
I wanted to have transparency too so what I did is make two GUIs on top of each other, one as the background and the other one see-through, holding the GUI controls (gMain).
Then, in repeatedly_execute_always:

Code: ags

if (IsInterfaceEnabled() == false) gMain.Transparency = 50;
else gMain.Transparency = 0;


This way, only the buttons appear to become transparent when the interface is disabled.

Edit:

But Button.DisabledGraphic is a nice idea, it would allow for easy customization of the behaviour.

GarageGothic

Quote from: Redwall on Mon 07/02/2005 22:13:56
Quote from: GarageGothic on Mon 07/02/2005 11:53:01
Yeah, you're right. That is a good workaround. Of course this means that you need to have graphics for all disabled buttons :-\ But thanks for the suggestion, I'll probably do just that.

You could just pass the original graphic if it doesn't have one, couldn't you?

Um, well no, because you'd have to set the disabled mode to "Show as normal", or whatever it is called, for the whole game. So any button being disabled would look normal but remain unclickable unless they all had special graphics.

As for the transparency thing: Keep in mind that this wouldn't work if you're using an all-transparent gui. Possibly an option to darken/tint disabled buttons would be another solution.

strazer

Quote from: GarageGothic on Wed 09/02/2005 18:59:30As for the transparency thing: Keep in mind that this wouldn't work if you're using an all-transparent gui. Possibly an option to darken/tint disabled buttons would be another solution.

Are you referring to my idea?
It works great for me. Notice I wrote "see-through", i.e. setting fore- and background color to 0, not setting its transparency level.
What good is an all-transparent gui that you can't see? ;)

GarageGothic

I was referring to Radiants suggestion of making the buttons transparent, not your solution, which would work fine. But either way, that too would be a bit wonky if you were using a transparent interface in the first place.

And by "all-transparent" I was obviously referring to the whole window rather than just the buttons, not the degree of transparency, but you knew that ;)


SMF spam blocked by CleanTalk