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 | DRAWPOLY

Edit History

DRAWPOLY

DRAWPOLY array [,x-origin,y-origin [, scalef [, color]]] [COLOR color] [FILLED]

Home > Reference > Graphics

Draws a polyline. The array contains all the vertices of the polyline and can be defined as follow:

  • [[x1,y1], [x2,y2], … ,[xn,yn]]
  • [x1,y1, x2,y2, … , xn,yn]

Scaling factor scalef is applied after moving to the x- and y-origin.

Example 1: Polygon array with points

P = [[0,50], [50,0], [100,50], [0,50]]
                                    
drawpoly P                          ' Draw poly
drawpoly P, 200,200                 ' Draw poly with offset
drawpoly P, 200,200, 1.5 COLOR 4    ' Draw poly with offset, scaling and color

Example 2: Polygon array without points

P = [0,50, 50,0, 100,50, 0,50]      ' Even elements -> x
                                    ' Uneven elements -> y
                                    
drawpoly P                          ' Draw poly
drawpoly P, 200,200                 ' Draw poly with offset
drawpoly P, 200,200, 1.5 COLOR 4    ' Draw poly with offset, scaling and color
Code samples using DRAWPOLY
3d rotating cube with message.bas   bezier's autograph book.bas   bezierbounce.bas   chess.bas   curve.bas   drawpoly.bas   func.bas   lander.bas   networking.bas   polyline.bas   sokoban.bas   sokoban.bas   sokoban.bas   stars.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 Sat, 28 Jan 2023 22:27:45 +0100 | 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.