LINE
LINE [STEP] x,y [,|STEP x2,y2] [, color| COLOR color]
Draws a line from the point (x,y) to the point (x2,y2). If
STEP
is used, the graphics cursor is moved by a step of x
and y pixels. When color
is specified, instead of the
actual foreground color the line will be drawn with the color
color
.
By default LINE draws with anti-aliasing. For details, see: Xiaolin Wu’s line algorithm. To turn off anti-aliasing, add this to the start of your program:
option predef antialias off
Example 1: Line defined by two points
line 20, 20, 100, 100
Example 2: Line defined using STEP
line 20, 20, STEP 80,80 ' Line starts at point (20,20)
' and ends at point (20+80, 20+80) -> (100,100)
line STEP -80, -70, STEP 80,80 ' Line starts at last graphics cursor position
' plus step values (100-80,100-70) -> (20,30)
' and ends at last graphics cursor position
' plus step values (20+80, 30+80) -> (100,110)
line STEP -80, -70, 100, 120 ' Line starts at last graphics cursor position
' plus step values (100-80,110-70) -> (20,40)
' and ends at the point (100,120)
Example 3: Using colors
line 20, 30, 100, 110 color 2
line 20, 40, 100, 120, 3
line 20, 50, 100, 130, rgb(0,255,0)
line 20, 60, 100, 140 color rgb(0,255,255)
Code samples using LINE
000 hello.bas
001 3 ways to print hello 5 times.bas
002 numeric variables.bas
003 conditional branching.bas
004 loops.bas
005 challenge.bas
006 arrays+.bas
3d block lettes.bas
3d wire cube v1.bas
3d wire cube.bas
3d_palmx.bas
3d_torus.bas
3dtictac.bas
3dtorus.bas
3dttt.bas
3dttt.bas
4tune.bas
A Rubens, Peter Paul Landscape.bas
amortig.bas
analog clock.bas
anball 1.0.bas
anomail.bas
Another center finder.bas
another look at trig functions.bas
aquarium v2.bas
autumn scene.bas
Balleta 2-11-15.bas
base64.bas
betrayal: crows ii.bas
Graphics
ARC
CHART
CIRCLE
COLOR
DRAW
DRAWPOLY
IMAGE
LINE
PAINT
PEN
PLOT
POINT
PSET
RECT
RGB
RGBF
SHOWPAGE
TEXTHEIGHT
TEXTWIDTH
TXTH
TXTW
VIEW
WINDOW
XMAX
XPOS
YMAX
YPOS
If there is insufficient information on this page and you wish learn more about LINE,
please send an email to smallbasic@gmail.com. You can help to improve information about
LINE by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.