com.threerings.media.tile
Class TileSubsetMultiFrameImage

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

public class TileSubsetMultiFrameImage
extends TileMultiFrameImage

A MultiFrameImage implementation that obtains its image frames from a tileset but that only uses a subset of the tiles available.


Field Summary
protected  int _startIdx
          Index of the tile with which we begin this subset.
 
Fields inherited from class com.threerings.media.tile.TileMultiFrameImage
_source, _tileCount
 
Constructor Summary
TileSubsetMultiFrameImage(TileSet source, Colorization[] zations, int startIdx, int numTiles)
          Creates a recoolored tile MFI which will obtain its image frames from the specified source tileset.
TileSubsetMultiFrameImage(TileSet source, int startIdx, int numTiles)
          Creates a tile MFI which will obtain its image frames from the specified source tileset.
 
Method Summary
 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 com.threerings.media.tile.TileMultiFrameImage
getFrameCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_startIdx

protected int _startIdx
Index of the tile with which we begin this subset.

Constructor Detail

TileSubsetMultiFrameImage

public TileSubsetMultiFrameImage(TileSet source,
                                 int startIdx,
                                 int numTiles)
Creates a tile MFI which will obtain its image frames from the specified source tileset.


TileSubsetMultiFrameImage

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

Method Detail

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
Overrides:
getWidth in class TileMultiFrameImage

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
Overrides:
getHeight in class TileMultiFrameImage

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
Overrides:
paintFrame in class TileMultiFrameImage

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
Overrides:
hitTest in class TileMultiFrameImage