Difference between revisions of "Paintutils (API)"
From ComputerCraft Wiki
TheCoryKid (Talk | contribs) m (Removed the NeedsWork (it no longer explained what needed work), adjusted column widths, changed int to number, added <em> tags.) |
(use API table template) |
||
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 a default API for advanced computers which can draw pixels and lines, and load and draw image files. | ||
− | + | {{API table|Paintutils|image=Grid disk.png|2= | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | {{API table/row | |
+ | |[[paintutils.loadImage]]({{type|string}} path)|{{type|table}} image | ||
+ | |Returns an image object from <var>path</var>. | ||
+ | |odd}} | ||
− | + | {{API table/row | |
− | + | |[[paintutils.drawImage]]({{type|table}} image, {{type|number}} x, {{type|number}} y)|{{type|nil}} | |
+ | |Draws an image at (<var>x</var>, <var>y</var>) where <var>image</var> is an image object. | ||
+ | |}} | ||
− | + | {{API table/row | |
− | + | |[[paintutils.drawPixel]]({{type|number}} x, {{type|number}} y, {{type|number}} colour)|{{type|nil}} | |
+ | |Draws a pixel at (<var>x</var>, <var>y</var>) in the specified <var>colour</var>. | ||
+ | |odd}} | ||
− | + | {{API table/row | |
− | < | + | |[[paintutils.drawLine]]({{type|number}} startX, {{type|number}} startY, {{type|number}} endX, {{type|number}} endY, {{type|number}} color)|{{type|nil}} |
+ | |Draws a line from (<var>startX</var>, <var>startY</var>) to (<var>endX</var>, <var>endY</var>) in the specified <var>colour</var>. | ||
+ | |}} | ||
− | + | }} | |
− | + | ||
− | + | ||
− | + | ||
[[Category:APIs]] | [[Category:APIs]] |
Revision as of 21:48, 14 September 2013
Paintutils is a default API for advanced computers which can draw pixels and lines, and load and draw image files.
Paintutils (API) | ||
---|---|---|
Function | Return values | Description |
paintutils.loadImage(string path) | table image | Returns an image object from path. |
paintutils.drawImage(table image, number x, number y) | nil | Draws an image at (x, y) where image is an image object. |
paintutils.drawPixel(number x, number y, number colour) | nil | Draws a pixel at (x, y) in the specified colour. |
paintutils.drawLine(number startX, number startY, number endX, number endY, number color) | nil | Draws a line from (startX, startY) to (endX, endY) in the specified colour. |