Page 1 of 1

How can I make white background in Screen 12??

Posted: Sun Sep 30, 2007 8:30 am
by GLindahl
Is there a way to make the output background white instead of black when using Screen 12?

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

Posted: Sun Sep 30, 2007 10:28 am
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

Posted: Sun Sep 30, 2007 10:28 am
by Mentat
This works:

Code: Select all

 SCREEN 12
DRAW "p15,1"
But you can change 15 to somethign else to change the color.

Posted: Sun Sep 30, 2007 10:39 am
by Mac
[quote="Mentat"]This works:[/quote]

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

Mac

Posted: Sun Sep 30, 2007 1:08 pm
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.

Posted: Sun Sep 30, 2007 6:32 pm
by Mac
[quote="Codemss"]actually very easy[/quote]

LOL! rubyNL, my main man!!

Mac (The QBasic Forum)