Color system

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
izidor
Veteran
Posts: 110
Joined: Wed Apr 22, 2009 3:13 am
Contact:

Color system

Post by izidor »

___________________________________________________
|__COLOR GRAY/DARK GREY ___________________________|
| |
| |
| COLOR RED/BLUE |
| |
| |
| |
| (SCREEN 9) |
| |
| |
| |
|___________________________________________________|

Is it possible to do this in the same time? And if it is how to do it?
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

You can change foreground colors. Background color substitutes for color 0 the default BG color in all screens. Two BG changes mean that the last one will be the BG unless you use a pause loop or INPUT.

When you change Screen modes, all previous data on the screen is erased like using CLS. Plus all color settings are lost!

Is that what you mean?
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
izidor
Veteran
Posts: 110
Joined: Wed Apr 22, 2009 3:13 am
Contact:

Post by izidor »

I want to do this:

Image
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

Try using ASCII character 219 to create the header. You could also make it using a LINE box in Screen 9.

It looks like the dark grey is a shadow. Just use a thinner box.

Screen 9 has 64 color backgrounds to choose from (0 to 63).

Screen 9 is a DAC screen, so the attribute numbers are different than Screen 12 or 13's 0 to 15. 1 to 5 are the same.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
izidor
Veteran
Posts: 110
Joined: Wed Apr 22, 2009 3:13 am
Contact:

Post by izidor »

I know how to use LINE statement, i want to have two texts with different backgrounds and foregrounds. So if it isn't trouble can you post the code?
Harry Potter
Veteran
Posts: 111
Joined: Sat Feb 21, 2009 8:19 am
Location: New York, U.S.

Post by Harry Potter »

You could first draw a box the size of a text character in the first position of the text; save it in an array using GET; write the text in the color Foreground XOR Background; then paste the box to every text character PRINTed using PUT in XOR mode. Other than that, you can't do split-screen on a PC.
Joseph Rose, a.k.a. Harry Potter
Creating magic in the computer community...or at least striving to! :(
izidor
Veteran
Posts: 110
Joined: Wed Apr 22, 2009 3:13 am
Contact:

Post by izidor »

Yes that's great but can you give an example?
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

You can't always get what you want......................

But if you try sometime, you get what you need!
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
izidor
Veteran
Posts: 110
Joined: Wed Apr 22, 2009 3:13 am
Contact:

Post by izidor »

Oh, then I will try something else.
Don't get me wrong but i am not good with graphics and toes things like GET and PUT. I am using QB64 so i will yous load an image.
izidor
Veteran
Posts: 110
Joined: Wed Apr 22, 2009 3:13 am
Contact:

Post by izidor »

That's true what you are talking about.
I just take and take but never give. But did you ever wonder why maybe because I need to learn, I want to make big things but i can barely do an easy LOOP.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

Just play around with stuff like you just did. There is no way to use two background colors at once. But you can create LINE boxes to use as fake backgrounds.

Try my Demonstrator link below.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Post Reply