cage.graphics
Class Animation

java.lang.Object
  extended by cage.graphics.Animation
All Implemented Interfaces:
VisualItem

public class Animation
extends java.lang.Object
implements VisualItem

An animation is an Image with several frames. The first frame of the animation will be used as the master frame, defining the size, etc. Individual frames can be accessed by the getFrame method. Sprites support Animations through the VisualItem interface.

Author:
Seth Marinello

Constructor Summary
Animation(java.lang.String name, java.lang.String filename)
          Instantiates a new animation.
 
Method Summary
 org.minueto.image.MinuetoImage getFrame(int index)
          Gets the frame.
 int getFrameCount()
          Gets the frame count.
 int getHeight()
          Gets the height.
 org.minueto.image.MinuetoImage getImage()
          Gets the image.
 java.lang.String getName()
          Gets the name.
 int getWidth()
          Gets the width.
 void scale(double xScale, double yScale)
          Scale.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Animation

public Animation(java.lang.String name,
                 java.lang.String filename)
Instantiates a new animation.

Parameters:
name - the name
filename - the filename
Method Detail

scale

public void scale(double xScale,
                  double yScale)
Description copied from interface: VisualItem
Scale.

Specified by:
scale in interface VisualItem
Parameters:
xScale - the x scale
yScale - the y scale

getFrame

public org.minueto.image.MinuetoImage getFrame(int index)
Gets the frame.

Parameters:
index - the index
Returns:
the frame

getFrameCount

public int getFrameCount()
Gets the frame count.

Returns:
the frame count

getName

public java.lang.String getName()
Description copied from interface: VisualItem
Gets the name.

Specified by:
getName in interface VisualItem
Returns:
the name

getImage

public org.minueto.image.MinuetoImage getImage()
Description copied from interface: VisualItem
Gets the image.

Specified by:
getImage in interface VisualItem
Returns:
the image

getWidth

public int getWidth()
Description copied from interface: VisualItem
Gets the width.

Specified by:
getWidth in interface VisualItem
Returns:
the width

getHeight

public int getHeight()
Description copied from interface: VisualItem
Gets the height.

Specified by:
getHeight in interface VisualItem
Returns:
the height

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object