PixelDisplay.line

From MiniScript Wiki
Revision as of 21:23, 10 June 2021 by JoeStrout (talk | contribs) (added an example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

PixelDisplay.line draws a line on the pixel display.

Arguments

Parameter Name Type Default Value Meaning
x1 number 0 horizontal position of one end of the line
y1 number 0 vertical position of one end of the line
x2 number 960 horizontal position of other end of the line
y2 number 640 vertical position of other end of the line
color color self.color color to draw
penSize number 1 width of line to draw

Example

A simple line using the current default color, and a pen size of 1:

gfx.line 100,200, 500,200

The following draws a series of yellow lines of increasing thickness:

for x in range(0, 960, 50)
	gfx.line 0,0, x,640, color.yellow, x/50
end for