首页 > 文档 > shapeMode()形状模式
2017
08-01

shapeMode()形状模式

Name

shapeMode()形状模式

   

Examples

shapeMode()形状模式 - 第1张  | Processing编程艺术

PShape bot

 

void setup() {

size(100, 100);

bot = loadShape(“bot.svg”);

}

 

void draw() {

shapeMode(CENTER);

shape(bot, 35, 35, 50, 50);

shapeMode(CORNER);

shape(bot, 35, 35, 50, 50);

}

Description

Modifies the location from which shapes draw. The default mode is shapeMode(CORNER), which specifies the location to be the upper left corner of the shape and uses the third and fourth parameters of shape() to specify the width and height. The syntax shapeMode(CORNERS) uses the first and second parameters of shape() to set the location of one corner and uses the third and fourth parameters to set the opposite corner. The syntax shapeMode(CENTER) draws the shape from its center point and uses the third and forth parameters of shape() to specify the width and height. The parameter must be written in “ALL CAPS” because Processing is a case sensitive language.

修改形状绘制的位置。默认模式为 shapeMode (), 它指定形状的左上角的位置, 并使用形状的第三个和第四参数 () 来指定宽度和高度。语法 shapeMode () 使用形状的第一个和第二个参数 () 来设置一个角的位置, 并使用第三个和第四参数设置相反的角。语法 shapeMode (中心) 从它的中心点绘制形状, 并使用形状 () 的第三和第四个参数来指定宽度和高度。由于处理是区分大小写的语言, 因此必须在所有大写字母中写入参数。

Syntax

shapeMode(mode)

Parameters

mode

int: either CORNER, CORNERS, CENTER

 

角、多个角、中心

Returns

void

Related

PShape
shape()
rectMode()



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。