Hallo Leute,
ist es möglich in AGS ein halbtransparentes durchscheinendes GUI zu machen? Ich glaube das ist nicht möglich, oder hat da einer einen Tipp?
P.S.: Einen guten Rutsch ins neue Jahr!
halbtransparente GUI möglich?
- Sebel
- Komplettlösungsnutzer
- Beiträge: 11
- Registriert: 04.10.2004, 11:06
- Wohnort: Köln
- Kontaktdaten:
Doch es geht, wirf mal einen Blick in die AGS-Hilfe:
SetGUITransparency (int gui, int amount)
Sets GUI to be AMOUNT % transparent.
Setting AMOUNT to 100 means it is totally invisible, and lower values represent varying levels of transparency. Pass AMOUNT as 0 to stop the GUI being semi-transparent.
NOTE: Transparency currently only works in hi-color games.
NOTE: Having a large transparent GUI can significantly slow down the engine.
Example:
SetGUITransparency(2, 50);
will make GUI 2 look semi transparent.
Regards,
Sebel
Sebel
- Sinitrena
- Tastatursteuerer
- Beiträge: 678
- Registriert: 08.05.2004, 01:01
- Wohnort: Frankfurt
- Kontaktdaten:
Auch helfen dürfte dir der folgende Text aus den BFAQ von TerranRich (http://bfaq.terran-x.com/#guis11)
Is it possible to have an inventory GUI (or any type of GUI) with a semi-transparent background? If so, what if I wanted to have the objects (or only certain ones) inside the GUI non-transparent?
Simple! Well, okay, maybe not really simple, but simple enough that anybody can do it. Now this all depends on whether your game is true-color or hi-color (256-color games cannot do this).
If you have a hi-color game, you will have to use two GUIs, one on top of the other. The bottom GUI will consist of everything that you want to appear semi-transparent. Then use the SetGUTransparency() function to make the entire GUI transparent. (See why we need two of them now?) On the top GUI, put everything that is NOT transparent, and set that GUI's background to 0 (fully transparent, no color). Make sure that both GUIs are in the same exact location and that you created the GUI that goes behind first.
If you are running a true-color game, it is much easier. Simply edit your background image (if you need a simple color, you'll still need an imported sprite) and change its transparency to whatever you need (it might be called "opacity" in certain programs, which is just the opposite of transparency). You must save the image as a .PNG file, which is the only file format with alpha-blended transparencies that AGS supports (as far as I know).
If you have any questions about making an entre image semitransparent using alpha channels, please do not ask in the Beginners' Tech Forum. Instead, as in the General Discussion Forum.
http://www.sinitrena.de.vu Meine Spiele: "A very special dog", "A magic stone", "James Bond - Who wants to live again?", "Lonely Night", "Death of an Angel", "The Witch, the Wizard and the Blue Cup", "Emerald Eyes"