How can I make white background in Screen 12??

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
GLindahl
Newbie
Posts: 1
Joined: Sun Sep 30, 2007 8:16 am

How can I make white background in Screen 12??

Post by GLindahl »

Is there a way to make the output background white instead of black when using Screen 12?
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Re: How can I make white background in Screen 12??

Post by Mac »

GLindahl wrote:Is there a way to make the output background white instead of black when using Screen 12?
I don't think so, but you can make a general white background for graphics.

Mac

Code: Select all

SCREEN 12: PAINT (1, 1), 15
LOCATE 5, 1
PRINT "Use 7 instead of 15 for not-so-bright"
PRINT
PRINT "Note that background for print is always black. No fix."
WHILE INKEY$ = "": WEND
SYSTEM
Last edited by Mac on Sun Sep 30, 2007 10:29 am, edited 1 time in total.
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post by Mentat »

This works:

Code: Select all

 SCREEN 12
DRAW "p15,1"
But you can change 15 to somethign else to change the color.
For any grievances posted above, I blame whoever is in charge . . .
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Post by Mac »

[quote="Mentat"]This works:[/quote]

Heh - glad you caught the error with DRAW P1,1. LOL!

Mac
User avatar
Codemss
Veteran
Posts: 124
Joined: Sun Jun 24, 2007 6:49 am
Location: Utrecht, The Netherlands
Contact:

Post by Codemss »

You can change the RGB values of a colour with out. This may look difficult, but it is actually very easy. Just use:
OUT &H3C8, colour (use 0 for background colour)
OUT &H3C9, Red(0-63)
OUT &H3C9, Green(0-63)
OUT &H3C9, Blue(0-63)

Use 63 for red, green and bluw to make it bright white. But, this looks the same as clour 15, so when you PRINT with colour 15 now, you cant see it. So, you have to use another color(COLOR 1 for example) or make color 15 black(RGB: 0, 0, 0).

To make color 0 white:
OUT &H3C8, 0
OUT &H3C9, 63
OUT &H3C9, 63
OUT &H3C9, 63

To make color 15 black:
OUT &H3C8, 0
OUT &H3C9, 0
OUT &H3C9, 0
OUT &H3C9, 0

There are also some routines around that you can use to print anywhere on the screen(so not only on the places you can reach with LOCATE), and without a background colour. I believe that these are for screen 13 (not sure), but I though I'd mention it anyway. They are also good when you want to do colour effects on the text.
Check out my site: <a href="http://members.lycos.nl/rubynl">Click here</a>
Hope you like it. Send some feedback if you want: <a href="mailto:basicallybest@live.nl">Mail me</a>
Codemss, before known as RubyNL
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Post by Mac »

[quote="Codemss"]actually very easy[/quote]

LOL! rubyNL, my main man!!

Mac (The QBasic Forum)
Post Reply