Introduction to Graphics Mode

TNT Basic has two modes for displaying its output...

Text Mode
In this mode, only numbers and strings can be output.

Graphics Mode
In this mode, complex images can be built up from different components.

Graphics mode is what would be used for most games since it can handle any image.

How does graphics mode work?

Graphical images are composed of 'pixels'. A pixel is a small square which has a specific colour. An image is composed of thousands of these tiny squares layed out in a grid.

An image may be built out of 10 pixels across and 20 pixels down. Each pixel has a unique x and y co-ordinate. The x co-ordinate can range between 0 and 9, the y co-ordinate can range between 0 and 19. Every individual pixel in the image can be refered to by its x,y co-ordinate.

The colour of each pixel is built from three components. These three components are the primary colours red, green and blue. Each of these components has a value between 0 and 255, from this any colour can be built by mixing them in the correct amounts. e.g

Red Green Blue
Black  0 0 0
White 255 255 255
Green 0 255 0
Yellow 255 255 0

What Graphics Mode Can Do

There are different types of graphics techniques that can be used in graphics mode...

Canvases
These hold an image (i.e. a large collection of pixels). These can also be refered to as a bitmap.

Sprites
These are used to represent any piece of graphic that can be moved around the screen. TNT Basic can move these around the screen easily and quickly and they can be any shape or size.

Drawing
Drawing simple shapes, lines and plotting individual pixels can also be done in TNT Basic. This can be done in any colour.


Table of contents