Reference imageMode()

imageMode()

Changes the location from which images are drawn when image() is called.

By default, the first two parameters of image() are the x- and y-coordinates of the image's upper-left corner. The next parameters are its width and height. This is the same as calling imageMode(CORNER).

imageMode(CORNERS) also uses the first two parameters of image() as the x- and y-coordinates of the image's top-left corner. The third and fourth parameters are the coordinates of its bottom-right corner.

imageMode(CENTER) uses the first two parameters of image() as the x- and y-coordinates of the image's center. The next parameters are its width and height.

Examples

Syntax

imageMode(mode)

Parameters

mode

either CORNER, CORNERS, or CENTER.

Notice any errors or typos? Please let us know. Please feel free to edit src/image/loading_displaying.js and open a pull request!

Related References