Difference between revisions of "Paintutils.drawLine"
From ComputerCraft Wiki
(Changed output.) |
Bomb Bloke (Talk | contribs) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
{{Function | {{Function | ||
− | + | |name=paintutils.drawLine | |
− | + | |args={{type|number}} startX, {{type|number}} startY, {{type|number}} endX, {{type|number}} endY, {{type|number}} [[color (API)|color]] | |
− | + | |api=paintutils | |
− | + | |returns=None | |
− | + | |addon=ComputerCraft | |
− | + | |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.<br><br> | |
− | + | ||
+ | In builds prior to ComputerCraft 1.6, the color parameter is optional - if omitted, the current background color will be used instead. | ||
+ | |examples= | ||
{{Example | {{Example | ||
− | |desc= | + | |desc=Draws a red line from the position (1, 2) to the position (9, 10). |
− | |code= | + | |code='''paintutils.drawLine(1, 2, 9, 10, [[color (API)|colors]].red)''' |
}} | }} | ||
}} | }} | ||
[[Category:API_Functions]] | [[Category:API_Functions]] |
Latest revision as of 05:57, 28 April 2014
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. In builds prior to ComputerCraft 1.6, the color parameter is optional - if omitted, the current background color will be used instead. | |
Syntax | paintutils.drawLine(number startX, number startY, number endX, number endY, number color) |
Returns | None |
Part of | ComputerCraft |
API | paintutils |
Examples
Example | |
Draws a red line from the position (1, 2) to the position (9, 10). | |
Code |
paintutils.drawLine(1, 2, 9, 10, colors.red) |