drawQuad()
Purpose
Draw an image or portion of an image on an area of the screen
Description
Draw the spcified part of an image to the specified part of the screen and with the specified tint
Syntax
drawQuad( handle, { sourcex, sourcey, sourcew, sourceh }, points, tint )
Arguments
handle Variable which stores the desired image file
sourcex Horizontal pixel coordinate in the source image from which to begin drawing
sourcey Vertical pixel coordinate in the source image from which to begin drawing
sourcew Width (in pixels) of the source image to draw
sourceh Height (in pixels) of the source image to draw
points Array of points of the target area of the screen (top left, top right, bottom right, bottom left)
tint colour name or RGB values { red, green, blue, opacity } between 0 and 1
Example
// draw image in centre with 100 pixel border and green tint
image = loadImage( "Ansimuz/CyberpunkStreetLayer2", false )
size = imageSize( image )
points = []
points[0] = { 100, 100 }
points[1] = { gWidth() - 100, 100 }
points[2] = { gWidth() - 100, gHeight() - 100 }
points[3] = { 100, gheight() - 100 }
drawQuad( image, { 0, 0, size.x, size.y }, points, green )
update()
sleep( 3 )
Associated Commands
clear(), createImage(), drawImage(), drawImageEx(), drawSheet(), loadImage(), update(), uploadImage()