com.threerings.cast.bundle
Class BundledComponentRepository.TileSetFrameImage

java.lang.Object
  extended by com.threerings.cast.bundle.BundledComponentRepository.TileSetFrameImage
All Implemented Interfaces:
ActionFrames
Enclosing class:
BundledComponentRepository

public static class BundledComponentRepository.TileSetFrameImage
extends Object
implements ActionFrames

Used to provide multiframe images using data obtained from a tileset.


Field Summary
protected  ActionSequence _actseq
          The action sequence for which we're providing frame images.
protected  int _dx
          A translation to apply to the images.
protected  int _dy
          A translation to apply to the images.
protected  int _fcount
          Frame and orientation counts.
protected  int _ocount
          Frame and orientation counts.
protected  IntIntMap _orients
          A mapping from orientation code to animation sequence index.
protected  TileSet _set
          The tileset from which we obtain our frame images.
 
Constructor Summary
BundledComponentRepository.TileSetFrameImage(TileSet set, ActionSequence actseq)
          Constructs a tileset frame image with the specified tileset and for the specified orientation.
BundledComponentRepository.TileSetFrameImage(TileSet set, ActionSequence actseq, int dx, int dy)
          Constructs a tileset frame image with the specified tileset and for the specified orientation, with an optional translation.
 
Method Summary
 ActionFrames cloneColorized(Colorization[] zations)
          Creates a clone of these action frames which will have the supplied colorizations applied to the frame images.
 ActionFrames cloneTranslated(int dx, int dy)
          Creates a clone of these action frames which will have the supplied translation applied to the frame images.
 TrimmedMultiFrameImage getFrames(int orient)
          Returns the multi-frame image that comprises the frames for the specified orientation.
 int getOrientationCount()
          Returns the number of orientations available in this set of action frames.
 Tile getTile(int orient, int index)
           
protected  int getTileIndex(int orient, int index)
           
 Mirage getTileMirage(int orient, int index)
           
 void getTrimmedBounds(int orient, int index, Rectangle bounds)
           
 int getXOrigin(int orient, int index)
          Returns the x offset from the upper left of the image to the "origin" for this character frame.
 int getYOrigin(int orient, int index)
          Returns the y offset from the upper left of the image to the "origin" for this character frame.
protected  void paintTile(Graphics2D g, int orient, int index, int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_set

protected TileSet _set
The tileset from which we obtain our frame images.


_actseq

protected ActionSequence _actseq
The action sequence for which we're providing frame images.


_dx

protected int _dx
A translation to apply to the images.


_dy

protected int _dy
A translation to apply to the images.


_fcount

protected int _fcount
Frame and orientation counts.


_ocount

protected int _ocount
Frame and orientation counts.


_orients

protected IntIntMap _orients
A mapping from orientation code to animation sequence index.

Constructor Detail

BundledComponentRepository.TileSetFrameImage

public BundledComponentRepository.TileSetFrameImage(TileSet set,
                                                    ActionSequence actseq)
Constructs a tileset frame image with the specified tileset and for the specified orientation.


BundledComponentRepository.TileSetFrameImage

public BundledComponentRepository.TileSetFrameImage(TileSet set,
                                                    ActionSequence actseq,
                                                    int dx,
                                                    int dy)
Constructs a tileset frame image with the specified tileset and for the specified orientation, with an optional translation.

Method Detail

getOrientationCount

public int getOrientationCount()
Description copied from interface: ActionFrames
Returns the number of orientations available in this set of action frames.

Specified by:
getOrientationCount in interface ActionFrames

getFrames

public TrimmedMultiFrameImage getFrames(int orient)
Description copied from interface: ActionFrames
Returns the multi-frame image that comprises the frames for the specified orientation.

Specified by:
getFrames in interface ActionFrames

paintTile

protected void paintTile(Graphics2D g,
                         int orient,
                         int index,
                         int x,
                         int y)

getTrimmedBounds

public void getTrimmedBounds(int orient,
                             int index,
                             Rectangle bounds)

getXOrigin

public int getXOrigin(int orient,
                      int index)
Description copied from interface: ActionFrames
Returns the x offset from the upper left of the image to the "origin" for this character frame. A sprite with location (x, y) will be rendered such that its origin is coincident with that location.

Specified by:
getXOrigin in interface ActionFrames

getYOrigin

public int getYOrigin(int orient,
                      int index)
Description copied from interface: ActionFrames
Returns the y offset from the upper left of the image to the "origin" for this character frame. A sprite with location (x, y) will be rendered such that its origin is coincident with that location.

Specified by:
getYOrigin in interface ActionFrames

cloneColorized

public ActionFrames cloneColorized(Colorization[] zations)
Description copied from interface: ActionFrames
Creates a clone of these action frames which will have the supplied colorizations applied to the frame images.

Specified by:
cloneColorized in interface ActionFrames

cloneTranslated

public ActionFrames cloneTranslated(int dx,
                                    int dy)
Description copied from interface: ActionFrames
Creates a clone of these action frames which will have the supplied translation applied to the frame images.

Specified by:
cloneTranslated in interface ActionFrames

getTileIndex

protected int getTileIndex(int orient,
                           int index)

getTile

public Tile getTile(int orient,
                    int index)

getTileMirage

public Mirage getTileMirage(int orient,
                            int index)