Package net.sf.robocode.ui.gfx

Examples of net.sf.robocode.ui.gfx.RenderImage


    double x, y;
    AffineTransform at;
    int battleFieldHeight = battleField.getHeight();

    if (drawGround && drawExplosionDebris) {
      RenderImage explodeDebrise = imageManager.getExplosionDebriseRenderImage();

      for (IRobotSnapshot robotSnapshot : snapShot.getRobots()) {
        if (robotSnapshot.getState().isDead()) {
          x = robotSnapshot.getX();
          y = battleFieldHeight - robotSnapshot.getY();

          at = AffineTransform.getTranslateInstance(x, y);

          explodeDebrise.setTransform(at);
          explodeDebrise.paint(g);
        }
      }
    }

    for (IRobotSnapshot robotSnapshot : snapShot.getRobots()) {
      if (robotSnapshot.getState().isAlive()) {
        x = robotSnapshot.getX();
        y = battleFieldHeight - robotSnapshot.getY();

        at = AffineTransform.getTranslateInstance(x, y);
        at.rotate(robotSnapshot.getBodyHeading());

        RenderImage robotRenderImage = imageManager.getColoredBodyRenderImage(robotSnapshot.getBodyColor());

        robotRenderImage.setTransform(at);
        robotRenderImage.paint(g);

        at = AffineTransform.getTranslateInstance(x, y);
        at.rotate(robotSnapshot.getGunHeading());

        RenderImage gunRenderImage = imageManager.getColoredGunRenderImage(robotSnapshot.getGunColor());

        gunRenderImage.setTransform(at);
        gunRenderImage.paint(g);

        if (!robotSnapshot.isDroid()) {
          at = AffineTransform.getTranslateInstance(x, y);
          at.rotate(robotSnapshot.getRadarHeading());

          RenderImage radarRenderImage = imageManager.getColoredRadarRenderImage(robotSnapshot.getRadarColor());

          radarRenderImage.setTransform(at);
          radarRenderImage.paint(g);
        }
      }
    }
  }
View Full Code Here


        if (explosionIndex >= 0 && frame >= 0) {
          if (!bulletSnapshot.isExplosion()) {
            double scale = sqrt(1000 * bulletSnapshot.getPower()) / 128;
            at.scale(scale, scale);
          }
          RenderImage explosionRenderImage = imageManager.getExplosionRenderImage(explosionIndex, frame);
          explosionRenderImage.setTransform(at);
          explosionRenderImage.paint(g);
        }
      }
    }
    g.setClip(savedClip);
  }
View Full Code Here

              explosions.add(frames);
            }
            break;
          }

          frames.add(new RenderImage(getImage(filename)));
        }
      }

      numExplosion = explosions.size();
      explosionRenderImages = new RenderImage[numExplosion][];
View Full Code Here

    return explosionRenderImages[which][frame];
  }

  public RenderImage getExplosionDebriseRenderImage() {
    if (debriseRenderImage == null) {
      debriseRenderImage = new RenderImage(getImage("/net/sf/robocode/ui/images/ground/explode_debris.png"));
    }
    return debriseRenderImage;
  }
View Full Code Here

    }
    return radarImage;
  }

  public RenderImage getColoredBodyRenderImage(Integer color) {
    RenderImage img = robotBodyImageCache.get(color);

    if (img == null) {
      img = new RenderImage(ImageUtil.createColouredRobotImage(getBodyImage(), new Color(color, true)));
      robotBodyImageCache.put(color, img);
    }
    return img;
  }
View Full Code Here

    }
    return img;
  }

  public RenderImage getColoredGunRenderImage(Integer color) {
    RenderImage img = robotGunImageCache.get(color);

    if (img == null) {
      img = new RenderImage(ImageUtil.createColouredRobotImage(getGunImage(), new Color(color, true)));
      robotGunImageCache.put(color, img);
    }
    return img;
  }
View Full Code Here

    }
    return img;
  }

  public RenderImage getColoredRadarRenderImage(Integer color) {
    RenderImage img = robotRadarImageCache.get(color);

    if (img == null) {
      img = new RenderImage(ImageUtil.createColouredRobotImage(getRadarImage(), new Color(color, true)));
      robotRadarImageCache.put(color, img);
    }
    return img;
  }
View Full Code Here

TOP

Related Classes of net.sf.robocode.ui.gfx.RenderImage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.