Button opacity broken

How do I solve my button opacity issue

I use a button. The button is working fine, but on one scene, i lower the opacity to make it inactive (50) and when certain conditions match i put it back to 100% (so 255)
image
image
image

What is the expected result

I would like the button to be 100% opacity, back to its original state

What is the actual result

When i set the opacity back to 255, the button seems still not at 100% opacity, however the text, is well at 100%
image
image

Can you help me on that ?
Why the button doesn’t show up as expected ?

Thanks

Weird! I think this is a bug. I tried it and it’s doing the same thing.

can u show us the full events…included conditions …if there are.
It could be a repeated each frame issue.

Actually i think it’s a bug,
@RMDB , to avoid a repeated each frame issue, i have a condition that check if the opacity is lower than 255 :

and @RMDB it doesn’t explain why the text is full opacity and not the background…

thx for the screenshot.
can you post the first full condition too…i mean the one which set the initial opacity to 50?better if you can post the full event.

@RMDB Hey, it’s not a repeated each frame issue.

  • On beginning of scene → change opacity of button to 50
  • On any key released → change opacity of button to 255

The result is that the text (of the button) works normally and change opacity to 255, whereas the button’s opacity (the button’s sprite) stays at 50 when not hovered (changes to 255 only when hovered). So it’s clearly a bug.

@Pixalion I went ahead and transferred this topic to the Bugs reports section.

@RMDB here it is…

Hi,I’ve never said it was…
and i can’t replicate because this

works fine…

nope …changes to 255 when this


happen

i dunno if he’s using some store’s asset…but from the ss it seems not.

I would look in his structure vars zonecompletion things…probably they’re not triggering.

It doesn’t looks a bug to me.

I would not move something to bugs section without having done at least a minimal test.

Dude, I already said before that I tested it, and I also shared the events for it.

Here’s a simple setup to replicate, just a button and 2 events.

gif

FYI: the button’s sprite slightly changes opacity after a key press, but does not go all the way up to 255 and only does when it’s hovered.

I don’t think it is related to the problem of Pixallion.
I’ve also tested your event on any object and it works as it should…

Are u using an asset button?

also u’re not testing the mouse but the keys release

Did you test it with the “Button (panel sprite)” object?
Because the issue doesn’t occur with other object types.

It doesn’t matter as far as my testing goes, any event that’s triggered once does the same thing.

I tested rite now and…if u refer to this


it worked…(i wonder why it should not).

But what are u saying is probably related to other things…
Maybe sharing a little project is the best way to check if this bug exists

“Panel sprite” is not the same as the “Button” object. Try it with this:

img

thaz what i thought… that is an extension…
the op never said it was using an extension…thaz why i said above that i dunno if he’s using a custom button or a premeade/asset (behavioured?) one.

That is a different thing, bcs everything could happen.
From a first glance the problem could be here in ther extension bcs the tween in your case…but i’m not gonna dig in it …since i don’t think is related to the OP.

But even so…it still doesn’t look like a bug to me.
Like it seems you’re trying to override a behaviour.

I use indeed a Button (panel sprite), no extra behavior, variable or effect applied to it.

1 Like

then You should dig in the bahviour since i see a lot of opacity changes there

The OP didn’t mention it as an extension because the “Button” object is one of the main objects in GDevelop where you add it just like you add any other object. So I won’t call it an extension.

Sure it uses an extension to function (which is automatically added by default), but since you have the option to change the opacity via an action, it should not conflict with the the internal functionality and produce this bug.

Let the team at GDevelop check and decide whether it’s a bug or not instead of making this thread longer than it should and more complicated for them to follow.

If an action to change the opacity is available, you should be able to use it without any issues.

1 Like

I’ll do that, but it seems a pretty tedious thing for just a prefab button.
By the way don’t you think those button, to be fully usable, should contain a simple “disable” state (as all UserInterface button should) ?

You can try a workaround for now by adding a “blending mode” effect on the button with opacity of 0.2, then enable / disable the effect, instead of changing opacity via an action.

1 Like