tickle.pde

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

PDE
33
字号
/** * Tickle.  *  * The word "tickle" jitters when the cursor hovers over. * Sometimes, it can be tickled off the screen. */PFont font;float x = 33; // X-coordinate of textfloat y = 60; // Y-coordinate of textvoid setup() {  size(200, 200);  font = loadFont("AmericanTypewriter-24.vlw");  textFont(font);  noStroke();}void draw() {  fill(204, 120);  rect(0, 0, width, height);  fill(0);  // If the cursor is over the text, change the position  if ((mouseX >= x) && (mouseX <= x+55) &&    (mouseY >= y-24) && (mouseY <= y)) {    x += random(-5, 5);    y += random(-5, 5);  }  text("tickle", x, y);}

⌨️ 快捷键说明

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