参考 imageMode()

imageMode()

调用 image() 更改图像的绘制位置。

默认情况下,image() 前两个参数是图像左上角的 x 和 y 坐标。接下来的参数是 它的宽度和高度。和上面相同,调用 imageMode(CORNER)

imageMode(CORNERS)也使用 image() 前两个参数作为图像左上角的 x 和 y 坐标。第三个和第四个参数是它右下角的坐标。

imageMode(CENTER) 使用前两个参数 image() 作为图像中心的 x 和 y 坐标。接下来的参数是它的宽度和高度。

示例

语法

imageMode(mode)

参数

mode

CORNER 、CORNERS或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!

相关参考