[FIXED] Panel Sprite (9-Patch) Initial Opacity Oddity

Hi, I would like to report an oddity when using a panel sprite object.

If you set a panel sprite to an initial opacity of 0 at the beginning of a scene and fade it in after some time, it seems to display full opacity for a tick before honoring the 0 opacity at initial load and then fading it in. So you will see a brief flicker of the panel sprite at 255 opacity before it fades in. Note that it does not need to be 0 on load and can be any opacity value. 0 value is just the easiest to see this issue.

Here is a simple event sheet to recreate the issue.

Place two objects, one a normal sprite and the other a panel sprite. Both are set to 0 opacity on scene load and fade in after 2 seconds. The Return key reloads the scene so you can see this flicker on the panel sprite before it fades in.

A workaround is to place the panel sprite outside of the viewport at full opacity on load then set the opacity to 0 before putting it back into the viewport for the fade in, suggesting that the panel sprite object needs to be displayed anywhere at full opacity before that first opacity change can be made reliably.

Once in the scene you can set the opacity to 0 or any value and fade in with no issues after that. It’s that very first draw call.

Thank you for your attention.

I can reproduce the bug, I’ll report this bug to the developers!
Thanks for your bug report!

If you want to follow the bug on the tracker:

1 Like

I cannot reproduce this anymore using the example project given on Panel Sprite 9-patch, opacity bug at beginning of the scene · Issue #2830 · 4ian/GDevelop · GitHub - is this still happening? :slight_smile:

EDIT: actually I was able to reproduce this, it’s on the first frame the panel sprite is shown, not on the first frame of the scene :slight_smile:

1 Like

Thanks for your report @drearyweary, it was fixed for the next release (upper than b114).

1 Like