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 voiddrawLaser(Position src, Position dest)drawLaser() - Draws a laser between two pointsvoiddrawMoney(int monies, int width)drawMoney() - Draws the money text in upper right corner of user interface.voiddrawTower(Tower tower)drawTower() - Draws tower on their assigned position.voiddrawTroop(Troop tr)drawTroop() - Draws troop on their assigned position.voiddrawWin(int current, int toWin, int width)drawWin() - Draws the amount of units left for win.java.awt.image.BufferedImagegetFrame()getFrame()voidinitNewFrame(java.awt.image.BufferedImage background)initNewFrame() - Creates a new empty frame with the image supplied as the background.
-
Constructor Details
-
DrawImage
public DrawImage()
-
-
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
drawLaser() - Draws a laser between two points- Parameters:
src- - Position where laser startsdest- - 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 passedtoWin- - Units to winwidth- - Width of game window in which money is to be drawn.
-
drawTroop
drawTroop() - Draws troop on their assigned position.- Parameters:
tr- - Troop to be drawn.
-
drawTower
drawTower() - Draws tower on their assigned position.- Parameters:
tower- - Tower to be drawn.
-
getFrame
public java.awt.image.BufferedImage getFrame()getFrame()- Returns:
- - Background image.
-