PixelDisplay.drawImage
Revision as of 17:32, 16 August 2022 by WorldLover (talk | contribs)
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.