Difference between revisions of "Paintutils.drawLine"

From ComputerCraft Wiki
Jump to: navigation, search
(Small code fixes and changed colour to colours)
m (The color argument is not typeof color, it's an int representing a color-API value.)
Line 2: Line 2:
 
{{Function
 
{{Function
 
  |name=paintutils.drawLine
 
  |name=paintutils.drawLine
  |args=[[int (type)|int]] startX, [[int (type)|int]] startY, [[int (type)|int]] endX, [[int (type)|int]] endY, [[colour (API)|colour]] colour
+
  |args={{type|number}} startX, {{type|number}} startY, {{type|number}} endX, {{type|number}} endY, {{type|number}} [[colour (API)|colour]]
 
  |api=paintutils
 
  |api=paintutils
 
  |returns=nil
 
  |returns=nil

Revision as of 00:35, 12 July 2013


Grid Redstone.png  Function paintutils.drawLine
Draw a line on the screen from (startX startY) to (endX endY)
Syntax paintutils.drawLine(number startX, number startY, number endX, number endY, number colour)
Returns nil
Part of ComputerCraft
API paintutils

Examples

Grid paper.png  Example
This code will draw a red line from the position (1, 2) to the position (9, 10)
Code
paintutils.drawLine(1, 2, 9, 10, colours.red)