Difference between revisions of "Image.create"
Jump to navigation
Jump to search
(Created page with "The <c>Image.create</c> method creates a new Image object filled with solid color. You can then add content to this image with <c>Image.setPixel</c>. === Argumen...") |
(No difference)
|
Latest revision as of 03:19, 28 January 2021
The Image.create
method creates a new Image object filled with solid color. You can then add content to this image with Image.setPixel
.
Arguments
Parameter Name | Type | Default Value | Meaning |
---|---|---|---|
width | number | 64 | width of image to create, in pixels |
height | number | 64 | height of image to create, in pixels |
color | color | "#000000" | color to fill the new image |
Usage Notes
This method is called on the Image class itself, rather than on a particular image instance.
Note that another way to create an image at runtime is to draw into a PixelDisplay, and then grab the image with PixelDisplay.getImage.
Example
img = Image.create(10, 10, color.red)
gfx.drawImage img, 480, 320