首页 > 文档 > rect()矩形
2017
07-28

rect()矩形

Name

rect()矩形

   

Examples

rect()矩形 - 第1张  | Processing编程艺术

rect(30, 20, 55, 55);

rect()矩形 - 第2张  | Processing编程艺术

rect(30, 20, 55, 55, 7);

rect()矩形 - 第3张  | Processing编程艺术

rect(30, 20, 55, 55, 3, 6, 12, 18);

Description

Draws a rectangle to the screen. A rectangle is a four-sided shape with every angle at ninety degrees. By default, the first two parameters set the location of the upper-left corner, the third sets the width, and the fourth sets the height. The way these parameters are interpreted, however, may be changed with the rectMode() function.

To draw a rounded rectangle, add a fifth parameter, which is used as the radius value for all four corners.

To use a different radius value for each corner, include eight parameters. When using eight parameters, the latter four set the radius of the arc at each corner separately, starting with the top-left corner and moving clockwise around the rectangle.

在屏幕上绘制一个矩形。矩形是一个四棱形, 每个角度为九十度。默认情况下, 前两个参数设置左上角的位置, 第三个设置宽度, 第四设置高度。但是, 这些参数的解释方式可能会随 rectMode () 函数而改变。

 

若要绘制圆角矩形, 请添加第五参数, 它用作所有四角的半径值。

 

要对每个角使用不同的半径值, 请包括八参数。当使用八参数时, 后四分别设置每个角上的圆弧半径, 从左上角开始, 在矩形周围顺时针移动

Syntax

rect(a, b, c, d)

rect(a, b, c, d, r)

rect(a, b, c, d, tl, tr, br, bl)

Parameters

a

float: x-coordinate of the rectangle by default浮点型: 默认情况下矩形的 x 坐标

b

float: y-coordinate of the rectangle by default浮点型: 默认情况下矩形的 y 坐标

c

float: width of the rectangle by default

浮点型:
默认情况下矩形的宽度

d

float: height of the rectangle by default

浮点型:
默认情况下矩形的长度

r

float: radii for all four corners

所有四角的半径

tl

float: radius for top-left corner

左上角的半径

tr

float: radius for top-right corner

右上角的半径

br

float: radius for bottom-right corner

右下角半径

bl

float: radius for bottom-left corner

左下角半径

Returns

void

Related

rectMode()
quad()



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

留下一个回复

你的email不会被公开。