首页 > 文档 > shape()形状
2017
08-01

shape()形状

Name

shape()形状

   

Examples

shape()形状 - 第1张  | Processing编程艺术

PShape s;

 

void setup() {

s = loadShape(“bot.svg”);

}

 

void draw() {

shape(s, 10, 10, 80, 80);

}

Description

Draws shapes to the display window. Shapes must be in the sketch’s “data” directory to load correctly. Select “Add file…” from the “Sketch” menu to add the shape. Processing currently works with SVG, OBJ, and custom-created shapes. The shape parameter specifies the shape to display and the coordinate parameters define the location of the shape from its upper-left corner. The shape is displayed at its original size unless the c and d parameters specify a different size. The shapeMode() function can be used to change the way these parameters are interpreted.

将形状绘制到显示窗口。形状必须在草绘的数据目录中才能正确加载。从草绘菜单中选择添加文件…” 来添加形状。当前处理的工作是使用 svgobj 和自定义创建的形状。形状参数指定要显示的形状, 并且坐标参数从其左上角定义形状的位置。除非 c d 参数指定不同的大小, 否则该形状将以原始大小显示。shapeMode () 函数可用于更改这些参数的解释方式。

Syntax

shape(shape)

shape(shape, x, y)

shape(shape, a, b, c, d)

Parameters

shape

PShape: the shape to display

要显示的形状

x

float: x-coordinate of the shape

形状的X坐标

y

float: y-coordinate of the shape

形状的Y坐标

a

float: x-coordinate of the shape

形状的X坐标

b

float: y-coordinate of the shape

形状的Y坐标

c

float: width to display the shape

显示形状的宽度

d

float: height to display the shape

 

显示形状的高度

Returns

void

Related

PShape
loadShape()
shapeMode()



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

留下一个回复

你的email不会被公开。