DrawLine

Family: Core · 2 forms

What it does

DrawLine makes something happen at once: it draws. It takes x (a float), y (a float), x2 (a float), y2 (a float), red (an integer), green (an integer) and blue (an integer), and returns nothing. That is the first of 2 forms.

Syntax

1
DrawLine(x float, y float, x2 float, y2 float, red integer, green integer, blue integer)
2
DrawLine(x float, y float, x2 float, y2 float, color1 integer, color2 integer)

Parameters

NameTypeIn forms
xfloatall
yfloatall
x2floatall
y2floatall
redinteger1
greeninteger1
blueinteger1
color1integer2
color2integer2

Every form returns

nothing

Example · generated

Form 1, with every argument

DrawLine(100.0, 120.0, 1.0, 1.0, 255, 128, 128)DO  Sync()LOOP

Form 2, the short one

DrawLine(100.0, 120.0, 1.0, 1.0, 1, 1)DO  Sync()LOOP

DrawLine is called with values of the types its signature asks for. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

Related commands

200 commands in Core