From QB64 Wiki
Revision as of 01:50, 5 September 2009 by imported>Clippy
Jump to navigation Jump to search

The DRAW graphics statement uses a string value to draw lines on the screen.

Syntax: DRAW draw_string$

  • The draw string can be a draw value in quotation marks or a STRING variable using DRAW function letters.
  • DRAW starting coordinates can be set using PSET or PRESET.
  • Other graphic objects can be located at the last DRAW position.
  • The draw string uses certain letter direction designations followed by the number of pixels to move, an angle, coordinates or a color attribute.
* "C n": C designates the color n to be used in the draw statement string following it.
* "B": B before a line move designates that the line move will be hidden(Blind).
* "N": N before a line move designates that the line will return to the starting position(Null).
* "M x, y" can move to another coordinate area of the screen. When a + or - sign is used before a coordinate, it is a relative coordinate move.
* "S n": S changes the move size of the lines. Default is 4 (1 pixel)minimum. Using "S8" would double the pixel line moves.

  • DRAW uses certain letter designations to create line moves on the SCREEN (statement). Each move is followed by the number of pixels:
* "U n" U makes a line UP n pixels.
* "D n" D makes a line DOWN n pixels.
* "L n" L makes a line LEFT n pixels.
* "R n" R makes a line RIGHT n pixels.
* "E n" E makes a diagonal / line going UP and RIGHT n pixels.
* "F n" F makes a diagonal \ line going DOWN and RIGHT n pixels.
* "G n" G makes a diagonal / LINE going DOWN and LEFT n pixels.
* "H n" H makes a diagonal \ LINE going UP and LEFT n pixels

  • Angles are used to rotate the draw.
* "A n" A can use values of 1 to 3 to rotate up to n 90 degree angles.
* TA n" TA can use any n angle from -360 to 0 to 360 to rotate a DRAW (Turn Angle).

Example: Placing an octagon DRAW across the the screen with PSET.

FOR i% = 1 TO 11
PSET (i% * 50, 410), 15
DRAW "C12 R10 F10 D10 G10 L10 H10 U10 E10"

Note: Draw strings are flexible with spacing. No spacing is required!



Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage