scaleshape.pde

来自「This is processing for java examples.」· PDE 代码 · 共 27 行

PDE
27
字号
/** * Scale Shape.   * Illustration by George Brower.  *  * Move the mouse left and right to zoom the SVG file. * This shows how, unlike an imported image, the lines * remain smooth at any size. */PShape bot;void setup() {  size(640, 360);  smooth();  // 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);  translate(width/2, height/2);  float zoom = map(mouseX, 0, width, 0.1, 4.5);  scale(zoom);  shape(bot, -140, -140);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?