首页 > 文档 > ellipseMode()椭圆模式
2017
08-01

ellipseMode()椭圆模式

Name

ellipseMode()椭圆模式

   

Examples

ellipseMode()椭圆模式 - 第1张  | Processing编程艺术

ellipseMode(RADIUS); // Set ellipseMode to RADIUS

fill(255); // Set fill to white

ellipse(50, 50, 30, 30); // Draw white ellipse using RADIUS mode

 

ellipseMode(CENTER); // Set ellipseMode to CENTER

fill(100); // Set fill to gray

ellipse(50, 50, 30, 30); // Draw gray ellipse using CENTER mode

ellipseMode()椭圆模式 - 第2张  | Processing编程艺术ellipseMode()椭圆模式 - 第3张  | Processing编程艺术ellipseMode()椭圆模式 - 第4张  | Processing编程艺术

ellipseMode(CORNER); // Set ellipseMode is CORNER

fill(255); // Set fill to white

ellipse(25, 25, 50, 50); // Draw white ellipse using CORNER mode

 

ellipseMode(CORNERS); // Set ellipseMode to CORNERS

fill(100); // Set fill to gray

ellipse(25, 25, 50, 50); // Draw gray ellipse using CORNERS mode

Description

Modifies the location from which ellipses are drawn by changing the way in which parameters given to ellipse() are intepreted.

The default mode is ellipseMode(CENTER), which interprets the first two parameters of ellipse()as the shape’s center point, while the third and fourth parameters are its width and height.

ellipseMode(RADIUS) also uses the first two parameters of ellipse() as the shape’s center point, but uses the third and fourth parameters to specify half of the shapes’s width and height.

ellipseMode(CORNER) interprets the first two parameters of ellipse() as the upper-left corner of the shape, while the third and fourth parameters are its width and height.

ellipseMode(CORNERS) interprets the first two parameters of ellipse() as the location of one corner of the ellipse’s bounding box, and the third and fourth parameters as the location of the opposite corner.

The parameter must be written in ALL CAPS because Processing is a case-sensitive language.

通过更改给椭圆 () intepreted 的参数的方式来修改椭圆的绘制位置。

 

默认模式为 ellipseMode (中心), 它将椭圆 () 的前两个参数解释为形状的中心点, 而第三和第四参数是其宽度和高度。

 

ellipseMode (radius) 还使用椭圆 () 的前两个参数作为形状的中心点, 但使用第三和第四参数指定形状的宽度和高度的一半。

 

ellipseMode () 将椭圆 () 的前两个参数解释为形状的左上角, 而第三个和第四参数是其宽度和高度。

 

ellipseMode () 将椭圆 () 的前两个参数解释为椭圆边界框的一个角的位置, 第三个和第四参数作为相对角的位置。

 

该参数必须以所有大写形式写入, 因为处理是一种 case-sensitive 的语言。

Syntax

ellipseMode(mode)

Parameters

mode

int: either CENTER, RADIUS, CORNER, or CORNERS

模式
整数型:中心,半径、拐角和多个拐角

   

Returns

void

Related

ellipse()
arc()



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

留下一个回复

你的email不会被公开。