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.

Newcomers DBPro Corner / Clear a portion of the screen?

Author
Message
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 25th Dec 2012 18:38
Is there a way to clear just a portion of the screen? say the bottom half? I am doing a little text thing. I am not really into 2D or 3D yet. I am doing this little text program to learn how to use loops and functions. The top half has a title and menu, the bottom half is where the commands and text in the game goes. as new text pops up or new commands are entered everything will scroll up and go into the menu. Is there a way to just clear the bottom half of the screen after so many commands have been typed or after so much game text has filled the bottom half of the screen?

Thanks and Merry Christmas
Dragonslayer
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Dec 2012 18:43
Doesn't set camera view resolve your problem?


Cheers.

I'm not a grumpy grandpa
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 25th Dec 2012 18:52
I have not moved into 2D or 3D this is strictly a text program. Is there a way to do it with a cls command or something similar?

thanks!
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Dec 2012 19:04
Unless you make your own function and cls from time to time

I'm not a grumpy grandpa
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 25th Dec 2012 19:18
That may work, I was thinking about that. I don't really want to clear the whole screen because I don't want to wipe out the menu but I could make the function clear the screen and re-write the menu and other info I want to stay on the screen.

I wanted this to be a strictly text thing but I could delve into some 2D and make a sprite or text box bitmap etc... where all the game text and commands go.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 26th Dec 2012 04:28
usually easiest to just clear the whole screen and reprint the 'fixed' items just as they were.

chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th Dec 2012 13:03
That is exactly what cls do " clear screen"

I'm not a grumpy grandpa
Chris Tate
DBPro Master
15
Years of Service
Recently Online
Joined: 29th Aug 2008
Location: London, England
Posted: 26th Dec 2012 16:11
Here is one way to clear an area.


Although native 2D commands are unofficially 'obsolete' because of their slow unadorned nature. Use Advanced 2D.

Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 27th Dec 2012 00:03
I just downloaded that plugin and will have a look when I get time. Thanks!
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 27th Dec 2012 11:11
You could also draw a filled box over the area on the screen you'd like cleared. That's probably the simplest method. The Advanced2D command for that would be:

a2fillbox x1, y1, x2, y2, colour

TheComet

Burning Feet Man
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 6th Jan 2013 07:39
Absolutely love Advanced 2D commands. Not a project goes by where I don't use them!

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 7th Jan 2013 03:19
I think I got this now! Thanks!
Mdj
12
Years of Service
User Offline
Joined: 11th Mar 2012
Location: The Shire
Posted: 5th Apr 2013 23:07
Thanks to Diggsey for this plugin.

Login to post a reply

Server time is: 2024-03-29 10:51:38
Your offset time is: 2024-03-29 10:51:38