GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Download
  • News
  • Community
  • Resources
  • Language Reference
  • SmallBASIC Manual

This view

  • Original page
  • New address

GeezerVison is showing smallbasic.github.io — SmallBASIC | LINE

Edit History

LINE

LINE [STEP] x,y [,|STEP x2,y2] [, color| COLOR color]

Home > Reference > Graphics

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  
This page was last edited on Tue, 30 May 2023 10:37:55 +0200 | Markdown processed with pandoc 3.1.12.1
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.