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 Discussion / flickering background

Author
Message
ZoneMaster
23
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United States
Posted: 12th Jul 2006 18:30
Hi all,

How do you make the background (color) flicker, in otherwords change from black to red then back to black without destroying whats displayed on the screen like text or objects?

Thanks.

Klan Commander
Black Ice Klan [BIK]
flock
20
Years of Service
User Offline
Joined: 10th Mar 2006
Location: Earth
Posted: 12th Jul 2006 18:37
You could put up an image (screen's height and width) and run an if argument on an the incremented variable of the image's number. Make sure, then, to put this before any of the text.

a.k.a. "flockhound"
SFSW
23
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 12th Jul 2006 18:43 Edited at: 12th Jul 2006 18:47
Plain object in the background, use the color object command, render any other objects you want in front of it. Here's an example placing a background plain at 100 units from the camera and fades it from black to red and back to black:



Edit: Updated code to include some text and a few objects to show how it works without over-writing those graphics.

ZoneMaster
23
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United States
Posted: 12th Jul 2006 18:51 Edited at: 12th Jul 2006 18:52
umm not exactly what i wanted. I want ONLY the background to change. In other words make the background change colors without effecting the foreground (text) somewhat like an explosion or hit effect.

like this....

cls rgb(255,0,0)
wait 100
cls rgb(0,0,0)

only when i do it this way it clears all the text. I want something that DOESN'T do this.

Thank you again

Klan Commander
Black Ice Klan [BIK]
Kentaree
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 12th Jul 2006 18:54
backdrop on
color backdrop rgb(255,0,0)

However, if you're not redrawing whats on screen every loop, this will also clear it.

SFSW
23
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 12th Jul 2006 18:59
Ok, here's the same thing flashing red without effecting text and objects in the foreground:



ZoneMaster
23
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United States
Posted: 12th Jul 2006 19:51
I finally figured it out. Thanks for your help everyone!

Klan Commander
Black Ice Klan [BIK]

Login to post a reply

Server time is: 2026-07-07 00:49:40
Your offset time is: 2026-07-07 00:49:40