Difference between revisions of "Paintutils.drawImage"

From ComputerCraft Wiki
Jump to: navigation, search
m (Int -> {{type|number}})
 
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
 
{{Function
 
{{Function
|name=paintutils.drawImage
+
|name=paintutils.drawImage
|args=[[Table_(type)|table]] image handle, {{type|number}} x-position, {{type|number}} y-position
+
|args={{type|table}} image, {{type|number}} x, {{type|number}} y
|api=paintutils
+
|api=paintutils
|returns=[[Boolean_(type)|boolean]] true on success, otherwise false.
+
|returns={{type|boolean}} was the image printed successfully?
|addon=ComputerCraft
+
|addon=ComputerCraft
|desc=Draws an image whose top left corner is at x and y (images created with the [[Paint|paint]] program, then loaded using [[paintutils.loadImage]]).
+
|desc=Draws an image whose top left corner is at x and y coordinates (images created with the [[Paint|paint]] program, then loaded using [[paintutils.loadImage]]).
|examples=
+
|examples=
 
{{Example
 
{{Example
 
|desc=The program loads the image 'bar' (using [[paintutils.loadImage]]) onto the variable 'image', and then draws it on the screen, starting at position {3, 5}.
 
|desc=The program loads the image 'bar' (using [[paintutils.loadImage]]) onto the variable 'image', and then draws it on the screen, starting at position {3, 5}.
|code=image = [[paintutils.loadImage|paintutils.loadImage("bar")]]
+
|code= local image = [[paintutils.loadImage]]("bar")
  [[paintutils.drawImage|paintutils.drawImage(image, 3, 5)]]
+
  '''paintutils.drawImage(image, 3, 5)'''
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Latest revision as of 15:57, 10 April 2014


Grid Redstone.png  Function paintutils.drawImage
Draws an image whose top left corner is at x and y coordinates (images created with the paint program, then loaded using paintutils.loadImage).
Syntax paintutils.drawImage(table image, number x, number y)
Returns boolean was the image printed successfully?
Part of ComputerCraft
API paintutils

Examples

Grid paper.png  Example
The program loads the image 'bar' (using paintutils.loadImage) onto the variable 'image', and then draws it on the screen, starting at position {3, 5}.
Code
local image = paintutils.loadImage("bar")
paintutils.drawImage(image, 3, 5)