O'Reilly logo

DarkBASIC Pro Game Programming, Second Edition by Joshua R. Smith, Jonathan S. Harbour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Basic Graphics Programming

This section of the chapter involves some actual commands for drawing objects on the screen, unlike the previous sections, which dealt only with initializing and reading information about the video card.

Changing the Drawing Color

By default, DB uses white for graphics and text output. If you want to change the color, you can use the INK command in conjunction with RGB, as explained next.

The INK command changes the foreground and background colors used for graphics and text drawing commands. INK accepts two parameters—foreground color and background color—which must be integer values. Normally, you will use the RGB command to generate them. For example:

Forecolor = RGB(120, 120, 120) Backcolor = RGB(255, 0, 0) INK ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required