Message Board


Message Board > Fenix / Bennu / Gemix / DIV > Fading...

June 28, 2006, 12:07
Quiest
now with more happynes
142 posts

Can anyone explain to me how it works?

The tutorials I`ve found are in spanish...

I want to fade in the titlescreen, I place with put_screen, from black.

I so far managed to fade to black with this:

fade_on();
put_screen(game_fpg,1);
fade(256,256,256,1);
while(fading)frame;end;
fade_off();

But I don`t really know how to handle the fade command, and after the background has fully faded, it appears again...

Can anyone help?

Thanks in advance.

[Edited on June 28, 2006 by Quiest]
____________
Roundhousekick to the face, baby!
#
June 28, 2006, 13:26
Sandman
F3n!x0r
1194 posts

Code:
fade(0,0,0,64) // go to black immediately
put_screen(game_fpg,1); // place your screen
fade(100,100,100,1); // fade slowly to normal
while(fading)frame;end
// ...screen is done
// Now your problem was that it reappeared again after going to black again,
// which is because you use 16bit. Fading in 16bit always goes back to normal when
// not fading. In 0.84a anyway. So you must do something like:
fade(0,0,0,1); // fade slowly to black
while(fading)frame;end
clear_screen(); // or place a process with a huge almost black graph on top of everything


[EDIT]
INT FADE ( INT r, INT g, INT b, INT speed )
INT r,g,b: these are percentages. (100,100,100) means no change (0,0,0) means dark, (200,200,200) means white.
INT speed: ranging from 1-64, where 64 is immediately and 1 is slowly in about 60 frames.

Fade_Off is the same as Fade(0,0,0,16);
Fade_On is the same as Fade(100,100,100,16);

[Edited on June 28, 2006 by Sandman]
____________
BennuWiki
Yes, my avatar has grey borders in IE (so get a decent browser)
ROOFLEZ ROOFLEZ
#
June 28, 2006, 13:35
Rhovanion
Exterminated
666 posts
fade() uses % reds greens and blues. therefore use 100 instead of 256.
____________
#
June 28, 2006, 13:36
Rhovanion
Exterminated
666 posts
Quoting Sandman:
Code:
fade(0,0,0,64) // go to black immediately
put_screen(game_fpg,1); // place your screen
fade(100,100,100,1); // fade slowly to normal
while(fading)frame;end
// ...screen is done
// Now your problem was that it reappeared again after going to black again,
// which is because you use 16bit. Fading in 16bit always goes back to normal when
// not fading. In 0.84a anyway. So you must do something like:
fade(0,0,0,1); // fade slowly to black
while(fading)frame;end
clear_screen(); // or place a process with a huge almost black graph on top of everything


[EDIT]
INT FADE ( INT r, INT g, INT b, INT speed )
INT r,g,b: these are percentages. (100,100,100) means no change (0,0,0) means dark, (200,200,200) means white.
INT speed: ranging from 1-64, where 64 is immediately and 1 is slowly in about 60 frames.
OMG WHAT A COINCIDENCE! I saw "rooflez rooflez"
____________
#
June 28, 2006, 14:21
Quiest
now with more happynes
142 posts

Thank you all very much! :)


EDIT:
Hmm, fade(0,0,0,64); doesn`t work the background appears immediately. I replaced it with fade_off(); and it worked.

[Edited on June 28, 2006 by Quiest]
____________
Roundhousekick to the face, baby!
#
June 28, 2006, 17:09
Rhovanion
Exterminated
666 posts
maybe you need to use frame; after the fade(0,0,0,64); to let it happen? and fade_off(); has a frame; build in or something?


=O!!!!!
____________
#
July 7, 2006, 14:11
Rhovanion
Exterminated
666 posts
I also been looking 6 years for a system to fade out a screen and not specific objects. Only a bakground layer or something. Never found it.
____________
#
July 8, 2006, 15:50
Sandman
F3n!x0r
1194 posts

Make it yourself?
Use a process with a graph which overlaps the whole screen and is nearblack. Give the process a z value. Do:
Code:
alpha=0;
while(alpha<255)
alpha++
frame;
end

Anything with a z value above the z value of this process will be faded, the rest will remain visible.

[Edited on July 8, 2006 by Sandman]
____________
BennuWiki
Yes, my avatar has grey borders in IE (so get a decent browser)
ROOFLEZ ROOFLEZ
#
July 10, 2006, 20:09
Rhovanion
Exterminated
666 posts
Never heard of a local var named alpha...

thanks.
____________
#
July 10, 2006, 20:47
Fiona
games are terrible
-9616558 posts

The transparency increments don't span the entire 256 though, there's only about 15 or something different levels, so don't expect something super smooth.
____________
laffo
#
July 11, 2006, 00:17
Eckolin
Quite Whiskered
388 posts

You can set the number of transitions with alpha_steps.
____________
Maker of Games...
Wisdom is supreme; therefore get wisdom.
Need help with coding? I probably wrote something similar.
#
July 11, 2006, 00:24
Fiona
games are terrible
-9616558 posts

O rly. What does it default to and what is the highest it can go?
____________
laffo
#
July 11, 2006, 00:30
Eckolin
Quite Whiskered
388 posts

It defaults to 16.
Reasonable values would be 1 - 256. Don't use 0 unless you NEVER use alpha. The case of alpha>=256 is rendered independently and always fully opaque.

[Edited on July 11, 2006 by Eckolin]
____________
Maker of Games...
Wisdom is supreme; therefore get wisdom.
Need help with coding? I probably wrote something similar.
#
July 11, 2006, 00:49
Fiona
games are terrible
-9616558 posts

15 was a bloody good guess. :O
____________
laffo
#
July 11, 2006, 03:05
Sandman
F3n!x0r
1194 posts

Actually you were right, as 16 levels have 15 transitions. :P
____________
BennuWiki
Yes, my avatar has grey borders in IE (so get a decent browser)
ROOFLEZ ROOFLEZ
#
July 11, 2006, 03:37
Fiona
games are terrible
-9616558 posts

:psyduck:
____________
laffo
#
July 11, 2006, 07:49
Mezzmer
Square-theorist
792 posts

just because you drew that Ferret.
____________
#
July 11, 2006, 16:17
Fiona
games are terrible
-9616558 posts

How about I didn't.
____________
laffo
#
July 11, 2006, 19:27
PEader
お前はもう死んでいる
1486 posts

Quoting Squarepusher:
just because you drew that Ferret.

OMG jeaoulousy! :moustache:
____________
I see 57,005 people.
#
July 21, 2006, 22:10
Rhovanion
Exterminated
666 posts
my god, this ought to be amazing... I'm wondering if there's an alternative to DIV's roll_pallette() but in 16 bit.

[Edited on July 21, 2006 by Rhovanion]
____________
#
July 22, 2006, 00:14
DTM
Earthling!
821 posts

I could never get roll palette to work.
____________
:o
#
July 22, 2006, 01:53
Rhovanion
Exterminated
666 posts
now that you mention it... is there any way to change colours dynamically, like a heat glow effect on a lava rock?map_get_pixel and map_put_pixel might be a too hungry method...
____________
#
July 22, 2006, 03:08
Sandman
F3n!x0r
1194 posts

Fourth post, bottom
____________
BennuWiki
Yes, my avatar has grey borders in IE (so get a decent browser)
ROOFLEZ ROOFLEZ
#

Message Board > Fenix / Bennu / Gemix / DIV > Fading...

Quick reply


You must log in or register to post.
Copyright © 2005 Booleansoup.com
Questions? Comments? Bug reports? Contact us!