Difference between revisions of "Paintutils.drawLine"

From ComputerCraft Wiki
Jump to: navigation, search
m (The color argument is not typeof color, it's an int representing a color-API value.)
m (Expanded)
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
 
{{Function
 
{{Function
|name=paintutils.drawLine
+
|name=paintutils.drawLine
|args={{type|number}} startX, {{type|number}} startY, {{type|number}} endX, {{type|number}} endY, {{type|number}} [[colour (API)|colour]]
+
|args={{type|number}} startX, {{type|number}} startY, {{type|number}} endX, {{type|number}} endY [<nowiki/>, {{type|number}} [[color (API)|color]]]
|api=paintutils
+
|api=paintutils
|returns=nil
+
|returns=None
|addon=ComputerCraft
+
|addon=ComputerCraft
|desc=Draw a line on the screen from (startX startY) to (endX endY)
+
|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]].
|examples=
+
|examples=
 
{{Example
 
{{Example
|desc=This code will draw a red line from the position (1, 2) to the position (9, 10)
+
|desc=Draws a red line from the position (1, 2) to the position (9, 10).
|code=[[paintutils.drawLine]](1, 2, 9, 10, [[colour (API)|colours]].red)
+
|code='''paintutils.drawLine(1, 2, 9, 10, [[color (API)|colors]].red)'''
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Revision as of 16:09, 10 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. If color is specified then uses that color, otherwise uses last color set by term.setBackgroundColor.
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)