Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Fade in and out effect

Author
Message
Tidus
22
Years of Service
User Offline
Joined: 17th Oct 2003
Location:
Posted: 31st Oct 2003 13:09
How can i do fade in and out effect in my screen?
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 31st Oct 2003 13:14
You've got two choices - SET GAMMA, which doesn't work on all cards, and will only work in FSEX mode anyway.
The alternative (better and the way I do it is to use sprites) - Grab the area you want (or a black area), and use that as a sprite.


Avatar & Logo by Indi. Insert witty comment here...
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 31st Oct 2003 13:15 Edited at: 31st Oct 2003 13:30
use set gamma:

rem Fade in
for i = 1 to 255
set gamma i,i,i
next i

rem Fade out
for i = 255 to 1 step -1
set gamma i,i,i
next i

It'll only work in exclusive mode, though.

You can also put a large sprite over the whole screen and use set sprite alpha to fade that in / out.

"The trouble with the French is that they have no word for 'entreprenuer'" - Pres. George W Bush
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 31st Oct 2003 13:15
lol my slow typing catches me out again -_-

"The trouble with the French is that they have no word for 'entreprenuer'" - Pres. George W Bush
Scraggle
Moderator
23
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 31st Oct 2003 13:21 Edited at: 31st Oct 2003 13:23
Try FADE BITMAP bitmap number,fade value

If bitmap is zero then the default screen is used.

Try putting this code into your game loop:



It will fade the screen in and back out again.

This is, of course, assuming you want the whole screen to fade in/out.

Sleep ... those little slices of death. How I loathe them! - Edgar Allen Poe
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 31st Oct 2003 13:23
I find that Fade Bitmap tends to be slow...


Avatar & Logo by Indi. Insert witty comment here...
Sveinung
23
Years of Service
User Offline
Joined: 23rd Sep 2002
Location:
Posted: 31st Oct 2003 13:26
You can use a sprite in front of your camera, and play with the alpha values. Just remeber to keep it real close

Sveinung
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 31st Oct 2003 13:30
Quote: "You can also put a large sprite over the whole screen and use set sprite alpha to fade that in / out."


Quote: "You can use a sprite in front of your camera, and play with the alpha values. Just remeber to keep it real close "




"The trouble with the French is that they have no word for 'entreprenuer'" - Pres. George W Bush
Genesis Rage
22
Years of Service
User Offline
Joined: 5th Oct 2003
Location:
Posted: 31st Oct 2003 22:20
what if you wanted to fade an object in/out... but fading from visible to invisible? Alpha Mapping does not work as the 3d plain has a transparent texture, with alpha the transparent color turns solid black

==Main Computer==
Athlon XP 3000+, 1024mb, Radeon 9800 Pro 128mb 8xAGP, XP Pro

Login to post a reply

Server time is: 2026-07-26 08:30:50
Your offset time is: 2026-07-26 08:30:50