mirror of
https://github.com/processing/processing4.git
synced 2026-02-02 21:29:17 +01:00
25 lines
330 B
Plaintext
25 lines
330 B
Plaintext
/**
|
|
* SVGPShape
|
|
*
|
|
* How to load an SVG into a PShape
|
|
*/
|
|
|
|
// PShape object
|
|
PShape svg;
|
|
|
|
void setup() {
|
|
size(640, 360, P2D);
|
|
smooth();
|
|
// Load the SVG
|
|
svg = loadShape("star.svg");
|
|
}
|
|
|
|
void draw() {
|
|
background(255);
|
|
// Draw PShape at mouse location
|
|
translate(mouseX, mouseY);
|
|
shapeMode(CENTER);
|
|
shape(svg);
|
|
}
|
|
|