Package model

Class DrawImage

java.lang.Object
model.DrawImage

public class DrawImage
extends java.lang.Object
DrawImage draws image of next frame in AntiTowerDefence.
  • Constructor Summary

    Constructors 
    Constructor Description
    DrawImage()  
  • Method Summary

    Modifier and Type Method Description
    void drawLaser​(Position src, Position dest)
    drawLaser() - Draws a laser between two points
    void drawMoney​(int monies, int width)
    drawMoney() - Draws the money text in upper right corner of user interface.
    void drawTower​(Tower tower)
    drawTower() - Draws tower on their assigned position.
    void drawTroop​(Troop tr)
    drawTroop() - Draws troop on their assigned position.
    void drawWin​(int current, int toWin, int width)
    drawWin() - Draws the amount of units left for win.
    java.awt.image.BufferedImage getFrame()
    getFrame()
    void initNewFrame​(java.awt.image.BufferedImage background)
    initNewFrame() - Creates a new empty frame with the image supplied as the background.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • initNewFrame

      public void initNewFrame​(java.awt.image.BufferedImage background)
      initNewFrame() - Creates a new empty frame with the image supplied as the background.
      Parameters:
      background - - The images used as a background on the image.
    • drawLaser

      public void drawLaser​(Position src, Position dest)
      drawLaser() - Draws a laser between two points
      Parameters:
      src - - Position where laser starts
      dest - - Position where laser ends
    • drawMoney

      public void drawMoney​(int monies, int width)
      drawMoney() - Draws the money text in upper right corner of user interface.
      Parameters:
      monies - - Amount of money to be drawn (written).
      width - - Width of game window in which money is to be drawn.
    • drawWin

      public void drawWin​(int current, int toWin, int width)
      drawWin() - Draws the amount of units left for win.
      Parameters:
      current - - Units passed
      toWin - - Units to win
      width - - Width of game window in which money is to be drawn.
    • drawTroop

      public void drawTroop​(Troop tr)
      drawTroop() - Draws troop on their assigned position.
      Parameters:
      tr - - Troop to be drawn.
    • drawTower

      public void drawTower​(Tower tower)
      drawTower() - Draws tower on their assigned position.
      Parameters:
      tower - - Tower to be drawn.
    • getFrame

      public java.awt.image.BufferedImage getFrame()
      getFrame()
      Returns:
      - Background image.