pattern.pde

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

PDE
35
字号
/** * Patterns.  *  * Move the cursor over the image to draw with a software tool  * which responds to the speed of the mouse.  */ void setup(){  size(640, 360);  background(102);  smooth();}void draw() {  // Call the variableEllipse() method and send it the  // parameters for the current mouse position  // and the previous mouse position  variableEllipse(mouseX, mouseY, pmouseX, pmouseY);}// The simple method variableEllipse() was created specifically // for this program. It calculates the speed of the mouse// and draws a small ellipse if the mouse is moving slowly// and draws a large ellipse if the mouse is moving quickly void variableEllipse(int x, int y, int px, int py) {  float speed = abs(x-px) + abs(y-py);  stroke(speed);  ellipse(x, y, speed, speed);}

⌨️ 快捷键说明

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