Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Shane 'ProgZmax' Stevens on Tue 11/10/2005 06:53:23

Title: Antialiasing not showing up on gui text (SOLVED)
Post by: Shane 'ProgZmax' Stevens on Tue 11/10/2005 06:53:23
As I hate posting retread questions I did a search for someone encountering this problem and had no luck (someone explicitly states having been able to get antialiased text on buttons and such but doesn't say how).  To the problem:

I'm trying to get a label control to display text that is antialiased on a gui (not a text window, which antialiases text with no problems).  I have also tried buttons and text boxes to no avail.  The antialias option is on (of course), the gui has a visible background, it's NOT transparent, and I've even tried putting backgrounds on the buttons,etc to see if that mattered.  The text appears as normal on the gui background without any antialiasing.

The reason I'm doing this in the first place is because of the way ags handles speech views and sierra style dialogs in general.  I don't like how it's handled at all and the function I've written essentially replaces it by allowing you to specify a view, loop number, mode (either foreground or background conversation - this determines whether to pause the game and make you click to proceed or not so Sierra style games can have dialogs going on without pausing the action), and even style (lucasarts or sierra) and of course the text to display.  With this function you will be able to load ALL of your speech animations into ONE view instead of many (if you have multiple portraits or speech anims) and simply pop from loop to loop.  What it won't do (probably ever) is resize the text gui based on word length or lip syncing, as those are internalized features that don't seem to be able to be controlled via scripting.  I may even add the ability to display a talking sprite animation along with the animated portrait in Sierra style mode (quite easy).

Any help with the antialiasing bit is appreciated. 

Title: Re: Antialiasing not showing up on gui text
Post by: strazer on Tue 11/10/2005 07:06:32
Use a true color image with an alpha channel as the GUI's background.

Unfortunately, this affects the transparency of all GUI controls on this GUI so you may have to use alpha-channeled images for these or put them on another GUI.
Title: Re: Antialiasing not showing up on gui text
Post by: Shane 'ProgZmax' Stevens on Tue 11/10/2005 07:15:26
Thanks for the quick reply, I'll give it a go.

Edit:  Wonderful, photoshop doesn't seem to save 32 bit images in a type compatible with AGS...sigh.
Title: Re: Antialiasing not showing up on gui text
Post by: strazer on Tue 11/10/2005 08:00:04
Use this image (http://www.strazer.net/ags/320x240x32.png) for testing.

Btw, the text only shows where the background image is non-transparent. I don't think it's possible to have anti-aliased text on a transparent background...
Title: Re: Antialiasing not showing up on gui text
Post by: Shane 'ProgZmax' Stevens on Tue 11/10/2005 12:53:50
I knew about the background image for the gui not being transparent already.  As to it working, the image you posted as well as one I made and one scotch made for me do not work properly.  The text is not antialiased or affected in any way.  Can someone confirm that this method works with a screenshot maybe?  Bear in mind I am NOT using a text window, I'm using a gui with a label control and using settext to write it myself since text windows pause the game.
Title: Re: Antialiasing not showing up on gui text
Post by: SSH on Tue 11/10/2005 13:40:56
EDIT:
After some experimenting with ProgZmax on #ags,. we find that the only way to have AA text on a GUI is to have NO background image for the gui at all.
Title: Re: Antialiasing not showing up on gui text
Post by: Shane 'ProgZmax' Stevens on Tue 11/10/2005 14:33:16
After playing around and talking with SSH it seems that you can only get the font to antialias if there is NO background sprite on the gui, just a background color.  The background color cannot be transparent, so thus ends my attempts at making a text window substitute.  Major suckage :<.

Edit:  You can have a background image so long as the gui background color is NOT transparent.  This eliminates the possibility of having non perfect rectangle guis, but it's better than nothing I guess.
Title: Re: Antialiasing not showing up on gui text
Post by: strazer on Tue 11/10/2005 18:08:55
Quote from: ProgZmax on Tue 11/10/2005 14:33:16This eliminates the possibility of having non perfect rectangle guis, but it's better than nothing I guess.

(http://www.strazer.net/ags/guitextalias.png)

AGS v2.7. 32-bit game, 32-bit GUI background image, GUI set to background color 1 (but any other works as well). If I set the GUI background color to 0, the text isn't anti-aliased anymore.
Title: Re: Antialiasing not showing up on gui text
Post by: Shane 'ProgZmax' Stevens on Tue 11/10/2005 18:36:26
How are you able to make the background color appear transparent around a non rectangular shape background image?  When I set background color > 0 it fills a bounding box rectangle around the image.
(http://custardsclutter.com/scrnshot.gif)
ags 2.7 32-bit 32-bit background image and background color set to 1.  If you look closely you can see the blue where the jagged background image has transparent parts. There is also a border color around it that seems to reappear constantly if I have background color > 0. 
Title: Re: Antialiasing not showing up on gui text
Post by: strazer on Tue 11/10/2005 19:09:59
Strange. This is the image (http://www.strazer.net/ags/guibackground.png) I've used.
Title: Re: Antialiasing not showing up on gui text
Post by: Shane 'ProgZmax' Stevens on Tue 11/10/2005 19:24:09
This is the one I am using, maybe you'll have better luck than I am?

http://custardsclutter.com/mindseyetextbgstatic.tga
Title: Re: Antialiasing not showing up on gui text
Post by: strazer on Tue 11/10/2005 19:37:24
Yep, works. ???

You have clicked "Yes" when you're asked if you want to use the alpha channel, right?

Edit: When importing the image, I mean.
Title: Re: Antialiasing not showing up on gui text
Post by: Shane 'ProgZmax' Stevens on Tue 11/10/2005 19:49:27
Aha, that fixed it.  Sorry for wasting your time.
Title: Re: Antialiasing not showing up on gui text
Post by: strazer on Tue 11/10/2005 19:54:14
No problem, I'm glad we could work it out. :)