High Color Fade to Grey

Started by canavan, Wed 23/04/2003 14:10:06

Previous topic - Next topic

canavan

I read somewhere in here that the new ver 2.54 now supports fading in high color.

I am making a game, and when my save/restore gui is active, i want the background to fade to grey. Since my game is high color, this was not possible (only in 256 color.)

I have upgraded to 2.54, but am curious as to if this is now possible... and, if so, how?

Thanks!

Ben

Do you mean fading so everything turns to one shade of gray, or fading to a grayscale image (decreasing the saturation)? If you're just fading to one shade of gray, you could probably use TintScreen, or just use a large gray object and fade it with SetObjectTransparency. You could also try out AVO's flashlight plugin - that might have something you could use..

If you want to change the saturation, I'm afraid you can only do that in 256 colors, unless you want to write your own plugin  :P

canavan

I am talking about the oh-so-famous cliche effect of when the save or restore gui is activated, the background changes to grey while the gui is in full color in the foreground, and then the background goes back to full color when the gui is deactivated.

I have seen the code for doing this in a 256 color game, but was told it is impossible in high color. I just saw a post that claims the new version 2.54 supports this kind of effect in high color games.

If not, then I am open for workaround suggestions on how to make this happen in high color.

Ben

Well, I guess the easiest way to do this is just have a character that is just a big gray box the size of the screen, and when the player opens the GUI, place that character in the current room and set the transparency to around 50% using SetCharacterTransparency. You can even have it fade in by doing something like this:

int gray = 1;
while (gray < 50) {
 SetCharacterTransparency(CHAR, gray);
 gray ++;
 Wait(1);
}
GUIOn(x);

I guess the only drawback to this is that it doesn't really make the picture grayscale, it just puts a transparent gray object in front of it, so there will still be color on the screen no matter what. But it will probably still look good.. Try it and see if it works.

Pumaman

Quote from: canavan on Wed 23/04/2003 15:32:37I just saw a post that claims the new version 2.54 supports this kind of effect in high color games.

Sorry no, 2.54 now supports normal fades in hi-color (ie. fade to and from black), but it doesn't support other styles of fading.

canavan

Ok stick with me because I am still a bit new:

I am opening a save load requestor (GUI/Interface 1) with thumbnails, and this is where my "fade to grey" would come in. The character's name is GREY and is just a large grey screen-sized box.

I need the portion of the script that would bring character GREY to the current room, center it if necessary (?) and remove it when the GUI goes off (later.) Any idea how that would fit into what I have?

// Open SAVE GUI

else if (button == 3){  
SetGlobalInt(14,1);
load_thumbnails();
SetButtonPic(1,10,1,7);

int gray = 1;
while (gray < 50) {
 SetCharacterTransparency(GREY, gray);
 gray ++;
 Wait(1);
}
InterfaceOn(1);}

Ben

#6
just use this when the GUI is turned on:

character[GREY].room = character[GetPlayerCharacter()].room;

and this when it's turned off:

character[GREY].room = -1;

You probably won't have to set an x and y position at run-time. If you set it correctly in the character editor it should always come up in the right place.

SMF spam blocked by CleanTalk