mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 03:11:08 +01:00
27 lines
801 B
Plaintext
27 lines
801 B
Plaintext
/**
|
|
* Load and Display a Shape.
|
|
* Illustration by George Brower.
|
|
*
|
|
* The loadShape() command is used to read simple SVG (Scalable Vector Graphics)
|
|
* files and OBJ (Object) files into a Processing sketch. This example loads an
|
|
* SVG file of a monster robot face and displays it to the screen.
|
|
*/
|
|
|
|
// The next line is needed if running in JavaScript Mode with Processing.js
|
|
/* @pjs preload="bot1.svg"; */
|
|
|
|
PShape bot;
|
|
|
|
void setup() {
|
|
size(640, 360);
|
|
// The file "bot1.svg" must be in the data folder
|
|
// of the current sketch to load successfully
|
|
bot = loadShape("bot1.svg");
|
|
}
|
|
|
|
void draw(){
|
|
background(102);
|
|
shape(bot, 110, 90, 100, 100); // Draw at coordinate (110, 90) at size 100 x 100
|
|
shape(bot, 280, 40); // Draw at coordinate (280, 40) at the default size
|
|
}
|