Problem setting transparency on GUIs in AGS 3.1 (Solved!)

Started by Ali, Tue 30/06/2009 09:59:48

Previous topic - Next topic

Ali

Hi,

I recently imported the tech demo of Nelly II into AGS 3.1 and the GUIs no longer fade in and out correctly. They appear to 'flash' because 100% transparency is rendered as solid white which fades away to reveal the GUI. This happens where the GUIs have alpha channels and where they do not.

The same thing occured when I replaced my code with the new Tween module. I couldn't find this problem when searching, I'd be grateful for any help.

- Ali

Gilbert

Can you post here the part of codes responsible for the effect? From the change log I see that there're some changes/fixes related to transparencies, that may or may not be related, so it might be possible that you need some code modifications.

Ali

This is the code I used:

Code: ags
    gBubble.Transparency=100;
    gBubbleUnderlay.Transparency=100;
    
    gBubble.Visible=true;
    gBubbleUnderlay.Visible=true;

    while (bubbleTrans>15){
        
      bubbleTrans=bubbleTrans-15;
      
      if (bubbleTrans<15) bubbleTrans=15;
      
      gBubble.Transparency=bubbleTrans;
      
      gBubbleUnderlay.Transparency=bubbleTrans;
           
      Wait(1);
    }


But I tried replacing it with the Tween module's function to the same effect. I should mention that these two GUIs overlap, in case that is relevant. One has a solid background (to allow anti-aliased text) and the other surrounds it with alpha channeled edges to create a speech bubble effect.

Gilbert

Seems okay to me.
What value was bubbleTrans initially set to?

Vince Twelve

I had a similar issue in an early version of AGS 3.0, but I thought it was fixed.  The issue was that I was starting the GUI with an 8 bit graphic, then when the game was started, that GUI was created as an 8 bit graphic, so when I would then change it to something with alpha transparency, it would render all the alpha as solid white, assuming it was still 8 bit.  I'm not sure if that's what's happening here, but it could be worth checking if you're setting the background graphic of the GUI to an 8 or 16 bit sprite at some point.

Ali

Thanks for the responses guys. bubbleTrans was 100.

I should mention that this code worked correctly in AGS 3.0. It's only with 3.1 that this odd problem occurs. Also the effect also works in DX5 mode.

Giving the text GUI a 32 bit backdrop prevents makes the text display with weird edges. Giving the surrounding bubble GUI a 32 bit backdrop makes it simply appear instead of fading in.

Please let me know if this helps explain the problem.

GarageGothic

Variable transparency for alpha channel sprites wasn't supported until version 3.1.2, so if that's what you want you need to update your editor. That shouldn't be a problem for non-alpha sprites though, but if they're 32-bit perhaps AGS deals with them as if they did have an alpha channel.

Ali

Updating the editor was the answer. Thanks GarageGothic, I'd missed version 3.1.2.

Transparent GUIs here I come!

SMF spam blocked by CleanTalk