PShape
Name 名称 |
PShape PShape类 |
||||||||||||||||||||||||||||||||||||||||||||||
Examples 例子 |
PShape s;
void setup() { size(100, 100); // The file “bot.svg” must be in the data folder // of the current sketch to load successfully s = loadShape(“bot.svg”); }
void draw() { shape(s, 10, 10, 80, 80); }
PShape square; // The PShape object
void setup() { size(100, 100); // Creating the PShape as a square. The corner // is 0,0 so that the center is at 40,40 square = createShape(RECT, 0, 0, 80, 80); }
void draw() { shape(square, 10, 10); } |
||||||||||||||||||||||||||||||||||||||||||||||
Description 描述 |
Datatype for storing shapes. Before a shape is used, it must be loaded with the loadShape() or created with the createShape(). The shape() function is used to draw the shape to the display window. Processing can currently load and display SVG (Scalable Vector Graphics) and OBJ shapes. OBJ files can only be opened using the P3D renderer. The loadShape() function supports SVG files created with Inkscape and Adobe Illustrator. It is not a full SVG implementation, but offers some straightforward support for handling vector data.
要创建一个新形状,使用createShape()函数。不要使用新的PShape()语法。 |
||||||||||||||||||||||||||||||||||||||||||||||
Fields 字段 |
|
||||||||||||||||||||||||||||||||||||||||||||||
Methods 方法 |
|
||||||||||||||||||||||||||||||||||||||||||||||
Constructor 构造函数 |
PShape(g, kind, params) |
- 本文固定链接: http://iprocessing.cn/2017/07/12/pshape类/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表