Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Kairus on Sat 07/02/2004 02:33:02

Title: Black room for messages
Post by: Kairus on Sat 07/02/2004 02:33:02
I wanted to know if it was possible to fade a room out and then display some messages when everything's black, then fade in again to the room (like a narrator that only speaks when the room's black).

The way I solved it was creating a new room with a black background where all that kind of messages are displayed, but it's difficult to keep track of the globalint that comes from one and another point of the script to display this or that message.

Is there a way to do it in the same room where it occurs? Because using FadeOut (x) and then Display ("whatever") it does the fade out and the message is displayed but cannot be seen.
Title: Re:Black room for messages
Post by: Darth Mandarb on Sat 07/02/2004 03:17:03
You could put an object the size of the screen that is just black and have it fade in over top of the screen, do what you need with messages, and then fade the object out.

You'd never have to leave the screen then.

Just a thought.
Title: Re:Black room for messages
Post by: a-v-o on Sat 07/02/2004 07:40:46
Instead of using a large object you can use a fullscreen GUI which is black and a labe on it. With SetGuiTransparency you can fade it in and out.
Title: Re:Black room for messages
Post by: Pumaman on Sat 07/02/2004 12:34:20
In 256-colour games, this is not possible since the screen palette is faded out (thus it's impossible to display anything on the screen until it is faded back in).

In hi-colour games, it could be possible - but I take it you've tried a Display between fadeout and fadein and it doesn't work? This would be an unofficial feature, I'll think about it.
Title: Re:Black room for messages
Post by: Kairus on Sat 07/02/2004 21:23:24
Yes, CJ, that's exactly what I've tried. My game is hi-color (16 bits, I guess) and it doesn't work.

Using an object that big could work but I think it can be very slow and take a lot of memory. I was trying to avoid that solution, but thaks anyway.

The GUI thing could help. I don't know if there's any problem in displaying messages when a GUI is over the screen, I suppose I'll give it a try.
Title: Re:Black room for messages
Post by: Gilbert on Mon 09/02/2004 02:21:46
Quote from: Pumaman on Sat 07/02/2004 12:34:20
In 256-colour games, this is not possible since the screen palette is faded out (thus it's impossible to display anything on the screen until it is faded back in).

Heh it is all possible, and may work even better than 16bit modes, if you really take full controls of your palette, you don't need to fade out ALL the colours, just leave out some slots for the texts. This is definately some effect I had planned to use.
Title: Re:Black room for messages
Post by: Ishmael on Mon 09/02/2004 16:41:24
For fading the GUI:

GUI named BLACK

//fadeout
int guifade;
SetGUITransparency(BLACK,100);
GUIOn(BLACK);
while (guifade > 0) {
SetGUITransparency(BLACK,guifade);
guifade--;
}

//fadeout
int guifade;
while (guifade < 100) {
SetGUITransparency(BLACK, guifade);
guifade++;
}
GUIOff(BLACK);

Just incase you need it ;D