cage.graphics
Class GraphicsEngine

java.lang.Object
  extended by cage.graphics.GraphicsEngine

public class GraphicsEngine
extends java.lang.Object

Cage and Carl User: Seth Marinello Date: May 10, 2007 Time: 4:43:58 PM.


Constructor Summary
GraphicsEngine()
           
 
Method Summary
static void addOverlayComponents(java.util.LinkedList<Overlay.NamedPanel> overlayContents)
          Adds the overlay components.
static Display getDisplay()
          Gets the display.
static int getHeight()
          Gets the height.
static java.util.LinkedList<Sprite> getSpriteList()
          Gets the sprite list.
static int getWidth()
          Gets the width.
static double getXScale()
          Gets the x scale.
static double getYScale()
          Gets the y scale.
static void removeALlOverlayComponents()
          Removes the all overlay components.
static void removeOverlayComponents(java.util.LinkedList<Overlay.NamedPanel> overlayContents)
          Removes the overlay components.
static void render()
          Draws the image of a Cage.Graphics.Sprite at its coordinates and adds it to the end of the sceneGraphics vector.
static void scaleGraphics()
          Scale the size of all Visual Items (Animations and Images).
static void setGraphics(java.util.LinkedList<Sprite> list)
          Sets the graphics.
static void setHeight(int height)
          Sets the height.
static void setup(java.lang.String title, boolean decorated)
          Create a Graphics engine and initialize all instance fields.
static void setWidth(int width)
          Sets the width.
static void setXScale(double xScale)
          Sets the x scale.
static void setYScale(double yScale)
          Sets the y scale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicsEngine

public GraphicsEngine()
Method Detail

setup

public static void setup(java.lang.String title,
                         boolean decorated)
Create a Graphics engine and initialize all instance fields.

Parameters:
title - The window title for the game.
decorated - Indicates if the window should have a titlebar or not.

getWidth

public static int getWidth()
Gets the width.

Returns:
the width

setWidth

public static void setWidth(int width)
Sets the width.

Parameters:
width - the new width

getHeight

public static int getHeight()
Gets the height.

Returns:
the height

setHeight

public static void setHeight(int height)
Sets the height.

Parameters:
height - the new height

getXScale

public static double getXScale()
Gets the x scale.

Returns:
the x scale

setXScale

public static void setXScale(double xScale)
Sets the x scale.

Parameters:
xScale - the new x scale

getYScale

public static double getYScale()
Gets the y scale.

Returns:
the y scale

setYScale

public static void setYScale(double yScale)
Sets the y scale.

Parameters:
yScale - the new y scale

render

public static void render()
Draws the image of a Cage.Graphics.Sprite at its coordinates and adds it to the end of the sceneGraphics vector. public static void addSprite(Sprite s){ sceneGraphics.add(s); } public static boolean removeSprite(Sprite s) { return sceneGraphics.remove(s); }


getDisplay

public static Display getDisplay()
Gets the display.

Returns:
the display

getSpriteList

public static java.util.LinkedList<Sprite> getSpriteList()
Gets the sprite list.

Returns:
the sprite list

setGraphics

public static void setGraphics(java.util.LinkedList<Sprite> list)
Sets the graphics.

Parameters:
list - the new graphics

addOverlayComponents

public static void addOverlayComponents(java.util.LinkedList<Overlay.NamedPanel> overlayContents)
Adds the overlay components.

Parameters:
overlayContents - the overlay contents

removeOverlayComponents

public static void removeOverlayComponents(java.util.LinkedList<Overlay.NamedPanel> overlayContents)
Removes the overlay components.

Parameters:
overlayContents - the overlay contents

removeALlOverlayComponents

public static void removeALlOverlayComponents()
Removes the all overlay components.


scaleGraphics

public static void scaleGraphics()
Scale the size of all Visual Items (Animations and Images). Then scale the location of all Sprites (and therefore HotSpots, which are also scaled for size) and then finally the location of overlays are scaled. The actual GUI Components in the Overlays are not resized (just location is changed), they will still fit all contents they had before.