Difference between revisions of "Paintutils (API)"

From ComputerCraft Wiki
Jump to: navigation, search
m (Methods fix, shit was all over the place.)
(Updated to API overview v2)
Line 1: Line 1:
 
Paintutils is an API to draw and load images
 
Paintutils is an API to draw and load images
  
==Methods==
+
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;">
{| border="1" cellpadding="2" cellspacing="0"
+
<tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;">
!style="background:#EEE" width="300px"|Method name
+
[[File:Grid_disk.png|24px]]&nbsp;&nbsp;
!style="background:#EEE" width="*"|Description
+
Paintutisl (API)
|-
+
</td></tr>
|[[paintutils.loadImage]](path)
+
 
|Returns an image object.
+
<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>
|-
+
 
|[[paintutils.drawImage]](image, x, y)
+
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.loadImage]](path)</td>
|Draws an image at (x, y) where image is an image object.
+
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns an image object.</td></tr>
|-
+
 
|[[paintutils.drawPixel]](x, y, colour)
+
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.drawImage]](image, x, y)</td>
|Draws a pixel at (x, y) in the colour specified.
+
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws an image at (x, y) where image is an image object.</td></tr>
|-
+
 
|[[paintutils.drawLine]](startX, startY, endX, endY, colour)
+
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.drawPixel]](x, y, colour)</td>
|Draws a line from (startX, startY) to (endX, endY) in the colour specified.
+
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws a pixel at (x, y) in the colour specified.</td></tr>
 +
 
 +
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[paintutils.drawLine]](startX, startY, endX, endY, colour)</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>
 +
 
 +
</table>
 +
 
  
 
[[Category:APIs]]
 
[[Category:APIs]]

Revision as of 22:19, 30 November 2012

Paintutils is an API to draw and load images

Grid disk.png   Paintutisl (API)

Method NameDescription
paintutils.loadImage(path) Returns an image object.
paintutils.drawImage(image, x, y) Draws an image at (x, y) where image is an image object.
paintutils.drawPixel(x, y, colour) Draws a pixel at (x, y) in the colour specified.
paintutils.drawLine(startX, startY, endX, endY, colour) Draws a line from (startX, startY) to (endX, endY) in the colour specified.