com.threerings.media.tile
Class TileMultiFrameImage

java.lang.Object
  extended by com.threerings.media.tile.TileMultiFrameImage
All Implemented Interfaces:
MultiFrameImage
Direct Known Subclasses:
TileSubsetMultiFrameImage

public class TileMultiFrameImage
extends Object
implements MultiFrameImage

A MultiFrameImage implementation that obtains its image frames from a tileset.


Field Summary
protected  TileSet _source
           
protected  int _tileCount
          The number of tiles in the source image.
 
Constructor Summary
TileMultiFrameImage(TileSet source)
          Creates a tile MFI which will obtain its image frames from the specified source tileset.
TileMultiFrameImage(TileSet source, Colorization[] zations)
          Creates a recoolored tile MFI which will obtain its image frames from the specified source tileset.
 
Method Summary
 int getFrameCount()
          Returns the number of frames in this multi-frame image.
 int getHeight(int index)
          Returns the height of the specified frame image.
 int getWidth(int index)
          Returns the width of the specified frame image.
 boolean hitTest(int index, int x, int y)
          Returns true if the specified frame contains a non-transparent pixel at the specified coordinates.
 void paintFrame(Graphics2D g, int index, int x, int y)
          Renders the specified frame into the specified graphics object at the specified coordinates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_source

protected TileSet _source

_tileCount

protected int _tileCount
The number of tiles in the source image.

Constructor Detail

TileMultiFrameImage

public TileMultiFrameImage(TileSet source)
Creates a tile MFI which will obtain its image frames from the specified source tileset.


TileMultiFrameImage

public TileMultiFrameImage(TileSet source,
                           Colorization[] zations)
Creates a recoolored tile MFI which will obtain its image frames from the specified source tileset.

Method Detail

getFrameCount

public int getFrameCount()
Description copied from interface: MultiFrameImage
Returns the number of frames in this multi-frame image.

Specified by:
getFrameCount in interface MultiFrameImage

getWidth

public int getWidth(int index)
Description copied from interface: MultiFrameImage
Returns the width of the specified frame image.

Specified by:
getWidth in interface MultiFrameImage

getHeight

public int getHeight(int index)
Description copied from interface: MultiFrameImage
Returns the height of the specified frame image.

Specified by:
getHeight in interface MultiFrameImage

paintFrame

public void paintFrame(Graphics2D g,
                       int index,
                       int x,
                       int y)
Description copied from interface: MultiFrameImage
Renders the specified frame into the specified graphics object at the specified coordinates.

Specified by:
paintFrame in interface MultiFrameImage

hitTest

public boolean hitTest(int index,
                       int x,
                       int y)
Description copied from interface: MultiFrameImage
Returns true if the specified frame contains a non-transparent pixel at the specified coordinates.

Specified by:
hitTest in interface MultiFrameImage