Difference between revisions of "Paintutils.loadImage"

From ComputerCraft Wiki
Jump to: navigation, search
m (Reverted edits by 199.19.105.156 (talk) to last revision by AfterLifeLochie)
Line 2: Line 2:
 
{{Function
 
{{Function
 
  |name=paintutils.loadImage
 
  |name=paintutils.loadImage
  |args=( path )
+
  |args=( path, x, y )
 
  |api=paintutils
 
  |api=paintutils
 
  |returns=True or false
 
  |returns=True or false
 
  |addon=ComputerCraft
 
  |addon=ComputerCraft
  |desc=Loads an image created with the built in Advanced Computer program paint.
+
  |desc=Draws an image object (image objects returned by paintutils.loadImage())
 
  |examples=
 
  |examples=
 
{{Example
 
{{Example
|desc=The program loads the image 'bar' onto the variable 'foo' and then shows it on screen:
+
|desc=The program loads the image 'bar' onto the variable 'image' and then draws it on the screen starting at position {3, 5}
|code=foo = paintutils.loadImage("bar")
+
|code=image = [[paintutils.loadImage("bar")]]
  [[paintutils.drawImage]](foo)
+
  paintutils.drawImage(image, 3, 5)
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Revision as of 08:38, 7 December 2012


Grid Redstone.png  Function paintutils.loadImage
Draws an image object (image objects returned by paintutils.loadImage())
Syntax paintutils.loadImage(( path, x, y ))
Returns True or false
Part of ComputerCraft
API paintutils

Examples

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