Difference between revisions of "Paintutils.drawImage"
From ComputerCraft Wiki
(Fixes and clarifications) |
MKlegoman357 (Talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
{{Function | {{Function | ||
− | + | |name=paintutils.drawImage | |
− | + | |args={{type|table}} image, {{type|number}} x, {{type|number}} y | |
− | + | |api=paintutils | |
− | + | |returns={{type|boolean}} was the image printed successfully? | |
− | + | |addon=ComputerCraft | |
− | + | |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= | |
{{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 | + | |code= local image = [[paintutils.loadImage]]("bar") |
− | + | '''paintutils.drawImage(image, 3, 5)''' | |
}} | }} | ||
}} | }} | ||
[[Category:API_Functions]] | [[Category:API_Functions]] |
Latest revision as of 15:57, 10 April 2014
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
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) |