Beispiel #1
0
 public Coin(String filename, int width, int height) {
   dim = new Dim(width, height, 1000, 700);
   ImageIcon ii = new ImageIcon(filename);
   ImageTransparency it = new ImageTransparency();
   ImageConverter ic = new ImageConverter();
   BufferedImage bi = ic.imageToBufferedImage(ii.getImage());
   coinImage = it.makeColorTransparent(bi, Color.white);
   getNewCoordinates();
   isVisible = false;
   isDead = false;
   appearTimer = new Timer();
   disappearTimer = new Timer();
   appear = new Appear();
   disappear = new Disappear();
   appearTimer.schedule(appear, getRandomAppearTime());
   appearTimerRunning = true;
   disappearTimerRunning = false;
   timersPaused = false;
 }
 public Image convert(Image image, ImageDesc desc) {
   for (ImageConverter f : this) {
     image = f.convert(image, desc);
   }
   return image;
 }