Difference between revisions of "Paintutils (API)"
From ComputerCraft Wiki
Smiley43210 (Talk | contribs) m (Added types) |
TheCoryKid (Talk | contribs) m (Removed the NeedsWork (it no longer explained what needed work), adjusted column widths, changed int to number, added <em> tags.) |
||
Line 1: | Line 1: | ||
− | + | Paintutils is a default API for advanced computers which can draw pixels and lines, and load and draw image files. | |
− | + | ||
− | Paintutils is | + | |
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"> | <table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"> | ||
Line 9: | Line 7: | ||
</td></tr> | </td></tr> | ||
− | <tr><td style="width: | + | <tr><td style="width: 550px; background: #E0E0E0; padding: .4em; font-weight:bold;">Method Name</td><td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td></tr> |
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.loadImage]]({{type|string}} path)</td> | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.loadImage]]({{type|string}} path)</td> | ||
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns an image object.</td></tr> | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns an image object from <em>path</em>.</td></tr> |
− | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.drawImage]](image, {{type| | + | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.drawImage]]({{type|table}} image, {{type|number}} x, {{type|number}} y)</td> |
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws an image at (x, y) where image is an image object.</td></tr> | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws an image at (<em>x</em>, <em>y</em>) where <em>image</em> is an image object.</td></tr> |
− | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.drawPixel]]({{type| | + | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.drawPixel]]({{type|number}} x, {{type|number}} y, {{type|number}} colour)</td> |
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws a pixel at (x, y) in the | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws a pixel at (<em>x</em>, <em>y</em>) in the specified <em>colour</em>.</td></tr> |
− | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.drawLine]]({{type| | + | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.drawLine]]({{type|number}} startX, {{type|number}} startY, {{type|number}} endX, {{type|number}} endY, {{type|number}} color)</td> |
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws a line from (startX, startY) to (endX, endY) in the | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws a line from (<em>startX</em>, <em>startY</em>) to (<em>endX</em>, <em>endY</em>) in the specified <em>colour</em>.</td></tr> |
</table> | </table> |
Revision as of 09:56, 14 May 2013
Paintutils is a default API for advanced computers which can draw pixels and lines, and load and draw image files.
Method Name | Description |
paintutils.loadImage(string path) | Returns an image object from path. |
paintutils.drawImage(table image, number x, number y) | Draws an image at (x, y) where image is an image object. |
paintutils.drawPixel(number x, number y, number colour) | Draws a pixel at (x, y) in the specified colour. |
paintutils.drawLine(number startX, number startY, number endX, number endY, number color) | Draws a line from (startX, startY) to (endX, endY) in the specified colour. |