Name |
rect()矩形 |
||||||||||||||||||
Examples |
rect(30, 20, 55, 55);
rect(30, 20, 55, 55, 7);
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 |
|
||||||||||||||||||
Returns |
void |
||||||||||||||||||
Related |
rectMode() |
- 本文固定链接: http://iprocessing.cn/2017/07/28/rect矩形/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表