import processing.core.*; import processing.xml.*; import java.applet.*; import java.awt.*; import java.awt.image.*; import java.awt.event.*; import java.io.*; import java.net.*; import java.text.*; import java.util.*; import java.util.zip.*; import java.util.regex.*; public class pointer5 extends PApplet { PImage p2; PImage click; boolean go = true; int totalTitles = 125; PImage[] images = new PImage[totalTitles]; PImage[] handimages = new PImage[totalTitles]; boolean mouse = false; public void setup(){ size(300, 300); for ( int i = 0; i< totalTitles; i++ ) { images[i] = loadImage( "pointer2.png" ); handimages[i] = loadImage( "hand.png" ); } } public void draw(){ noStroke(); fill (255, 10); rect (0,0,width,height); imageMode(CENTER); smooth(); float d = dist( mouseX + 4, mouseY + 4, width/2, height/2); int shortnum = PApplet.parseInt((320 - d)/3); // was /5 if (shortnum > 62){ go = true; } else{ go = false; } if (go == true){ int newshortnum = (shortnum - 64) * 2; println(newshortnum); for ( int i = 0; i< newshortnum; i++ ){ if (mouse == false){ image( images[i], random(width), random(height)); cursor(ARROW); } else{ image( handimages[i], random(width), random(height)); cursor(HAND); } } } } public void mouseReleased() { mouse = false; } public void mousePressed() { mouse = true; } static public void main(String args[]) { PApplet.main(new String[] { "--present", "--bgcolor=#666666", "--hide-stop", "pointer5" }); } }