Difference between revisions of "PixelDisplay.drawImage"
Jump to navigation
Jump to search
ZachStrout (talk | contribs) (Created page with "<c>PixelDisplay.drawImage</c> draws an Image, or a portion of an Image, to the pixel display. === Arguments === {| class="wikitable" |- ! Parameter Name !! Type !! D...") |
WorldLover (talk | contribs) |
||
Line 13: | Line 13: | ||
| ''bottom'' || number || 0 || bottom of destination area in the display | | ''bottom'' || number || 0 || bottom of destination area in the display | ||
|- | |- | ||
− | | ''width'' || number || | + | | ''width'' || number || -1 || width of destination area in the display |
|- | |- | ||
− | | ''height'' || number || | + | | ''height'' || number || -1 || height side of destination area in the display |
|- | |- | ||
| ''srcLeft'' || number || 0 || left side of source area in the image | | ''srcLeft'' || number || 0 || left side of source area in the image | ||
Line 21: | Line 21: | ||
| ''srcBottom'' || number || 0 || bottom side of source area in the image | | ''srcBottom'' || number || 0 || bottom side of source area in the image | ||
|- | |- | ||
− | | ''srcWidth'' || number || | + | | ''srcWidth'' || number || -1 || width of source area in the image |
|- | |- | ||
− | | ''srcHeight'' || number || | + | | ''srcHeight'' || number || -1 || height side of source area in the image |
+ | |- | ||
+ | | ''tint'' || string || "#FFFFFF" || tint applied when drawing the image | ||
|} | |} | ||
Latest revision as of 17:32, 16 August 2022
PixelDisplay.drawImage
draws an Image, or a portion of an Image, to the pixel display.
Arguments
Parameter Name | Type | Default Value | Meaning |
---|---|---|---|
image | image | 0 | picture to draw |
left | number | 0 | left side of destination area in the display |
bottom | number | 0 | bottom of destination area in the display |
width | number | -1 | width of destination area in the display |
height | number | -1 | height side of destination area in the display |
srcLeft | number | 0 | left side of source area in the image |
srcBottom | number | 0 | bottom side of source area in the image |
srcWidth | number | -1 | width of source area in the image |
srcHeight | number | -1 | height side of source area in the image |
tint | string | "#FFFFFF" | tint applied when drawing the image |
Usage Notes
To draw the entire image, specify only the image, and the bottom-left corner of where you want it to appear on the display (and optionally the desired width and height you want it to appear). To draw just a portion of an image, add the four additional parameters specifying the rectangular area in the source image that you want to draw.
Note that this should not be used for animation, as it is substantially slower than using a SpriteDisplay. But it is more efficient if you only need to draw something occasionally.