Ejemplo n.º 1
0
  // Set display up when config menu closes, run once
  public void setDisplay() {

    // Sets window icon to watoydo logo
    Image watLogo = null;
    this.setTitle("Atrophy");

    Toolkit toolkit = Toolkit.getDefaultToolkit();

    Image cursorImage = null;
    Point cursorHotSpot = new Point(0, 0);

    try {
      watLogo = ImageIO.read(ReadWriter.getResourceAsInputStream("images/watoydo/watoydoLogo.jpg"));
      cursorImage =
          ImageIO.read(
              ReadWriter.getResourceAsInputStream("images/atrophy/combat/icons/mouseWV.png"));
    } catch (FileNotFoundException fnfe) {
      System.err.println("watoydo window logo not found");
    } catch (IOException ioexcept) {
      System.err.println("watoydo window logo not found");
    }

    this.setIconImage(watLogo);

    Cursor customCursor = toolkit.createCustomCursor(cursorImage, cursorHotSpot, "Cursor");
    this.setCursor(customCursor);

    DisplayManager.getInstance().setFrameToScreen(this, windowed, this.resolution);

    this.setLocation(
        (int)
            (GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint().x
                - resolution[0] * 0.5),
        (int)
            (GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint().y
                - resolution[1] * 0.5));

    this.setVisible(true);

    // Stops flickering with screen redraws
    this.createBufferStrategy(2);
    bufferS = this.getBufferStrategy();
  }
Ejemplo n.º 2
0
  public void spawnTalkNode(TalkNode talkNode) {
    aiCrowd.addTalkNode(talkNode);

    BufferedImage computerImage = null;
    try {
      computerImage =
          ImageIO.read(
              ReadWriter.getResourceAsInputStream("images/atrophy/combat/icons/computer.png"));
    } catch (IOException e1) {
      System.err.println("No computer textures");
      System.exit(-1);
    }

    // Draw pc's to show talknode locations
    if (talkNode.hasLocation())
      MapPainter.applyImage(
          computerImage, new double[] {talkNode.getX(), talkNode.getY()}, 1.0f, mapDrawer);
  }