Difference between revisions of "Paintutils.loadImage"
From ComputerCraft Wiki
m (Grammatical fix) |
MKlegoman357 (Talk | contribs) |
||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=paintutils.loadImage | |name=paintutils.loadImage | ||
− | |args= | + | |args={{type|string}} path |
|api=paintutils | |api=paintutils | ||
− | |returns= | + | |returns={{type|table}} containing image data on success, otherwise {{type|nil}}. |
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc=Loads an image (images created with the [[Paint|paint]] program) | + | |desc=Loads an image (images created with the [[Paint|paint]] program). |
|examples= | |examples= | ||
{{Example | {{Example | ||
|desc=The program loads the image 'bar' onto the variable 'image', and then draws it on the screen, starting at position {3, 5} by using [[paintutils.drawImage]]. | |desc=The program loads the image 'bar' onto the variable 'image', and then draws it on the screen, starting at position {3, 5} by using [[paintutils.drawImage]]. | ||
− | |code=image = | + | |code= local image = '''paintutils.loadImage("bar")''' |
− | [[paintutils.drawImage | + | [[paintutils.drawImage]](image, 3, 5) |
}} | }} | ||
}} | }} | ||
[[Category:API_Functions]] | [[Category:API_Functions]] |
Latest revision as of 15:51, 10 April 2014
Function paintutils.loadImage | |
Loads an image (images created with the paint program). | |
Syntax | paintutils.loadImage(string path) |
Returns | table containing image data on success, otherwise nil. |
Part of | ComputerCraft |
API | paintutils |
Examples
Example | |
The program loads the image 'bar' onto the variable 'image', and then draws it on the screen, starting at position {3, 5} by using paintutils.drawImage. | |
Code |
local image = paintutils.loadImage("bar") paintutils.drawImage(image, 3, 5) |