Difference between revisions of "Paintutils.drawLine"

From ComputerCraft Wiki
Jump to: navigation, search
Line 6: Line 6:
 
|returns=None
 
|returns=None
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Draws a line on the screen starting from ''startX'' and ''startY'' and ending at ''endX'' and ''endY''. If ''color'' is specified then uses that color, otherwise uses last color set by [[term.setBackgroundColor]].
+
|desc=Draws a line on the screen starting from ''startX'' and ''startY'' and ending at ''endX'' and ''endY'', with color ''color''. Note that the cursor will be moved and background color will be changed by this function.
 
|examples=
 
|examples=
 
{{Example
 
{{Example

Revision as of 13:11, 25 April 2014


Grid Redstone.png  Function paintutils.drawLine
Draws a line on the screen starting from startX and startY and ending at endX and endY, with color color. Note that the cursor will be moved and background color will be changed by this function.
Syntax paintutils.drawLine(number startX, number startY, number endX, number endY, number color)
Returns None
Part of ComputerCraft
API paintutils

Examples

Grid paper.png  Example
Draws a red line from the position (1, 2) to the position (9, 10).
Code
paintutils.drawLine(1, 2, 9, 10, colors.red)