Name |
shapeMode()形状模式 |
||||
Examples |
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 |
|
||||
Returns |
void |
||||
Related |
PShape |
- 本文固定链接: http://iprocessing.cn/2017/08/01/shapemode形状模式-2/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表