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:
  |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]]

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


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