Difference between revisions of "Paintutils (API)"

From ComputerCraft Wiki
Jump to: navigation, search
m (Added types)
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:
{{NeedsWork|Function pages are added. When the time is appropriate, whoever deems that time, may take this NeedsWork template down'' [[User:SuicidalSTDz|SuicidalSTDz]] 20:40, 29 March 2013 (MSK)}}
+
Paintutils is a default API for advanced computers which can draw pixels and lines, and load and draw image files.
 
+
Paintutils is an API to draw and load images.
+
  
 
<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: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;">Method Name</td><td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td></tr>
+
<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|int}} x, {{type|int}} y)</td>
+
<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|int}} x, {{type|int}} y, {{type|int}} colour)</td>
+
<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 colour specified.</td></tr>
+
<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|int}} startX, {{type|int}} startY, {{type|int}} endX, {{type|int}} endY, {{type|int}} color)</td>
+
<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 colour specified.</td></tr>
+
<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.

Grid disk.png   Paintutils (API)

Method NameDescription
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.