|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.cast.CompositedActionFrames
public class CompositedActionFrames
An implementation of the MultiFrameImage interface that is used
to lazily create composited character frames when they are requested.
| Nested Class Summary | |
|---|---|
static class |
CompositedActionFrames.ComponentFrames
Used to associate a CharacterComponent with its ActionFrames for a particular action. |
protected class |
CompositedActionFrames.CompositedFramesKey
Used to cache composited frames for a particular action and orientation. |
| Field Summary | |
|---|---|
protected String |
_action
The action for which we're compositing frames. |
protected Map<CompositedActionFrames.CompositedFramesKey,CompositedMultiFrameImage> |
_frameCache
Used to cache our composited action frame images. |
protected ImageManager |
_imgr
The image manager from whom we can obtain prepared volatile images onto which to render our composited actions. |
protected CompositedActionFrames.CompositedFramesKey |
_key
Used to avoid creating a new key object every time we do a cache lookup. |
protected int |
_orientCount
The number of orientations. |
protected CompositedActionFrames.ComponentFrames[] |
_sources
Our source components and action frames. |
| Fields inherited from interface com.threerings.util.DirectionCodes |
|---|
CARDINAL_DIRECTIONS, CCW, CW, DIRECTION_COUNT, DOWN, EAST, EASTNORTHEAST, EASTSOUTHEAST, FINE_DIRECTION_COUNT, HORIZONTAL, LEFT, NONE, NORTH, NORTHEAST, NORTHNORTHEAST, NORTHNORTHWEST, NORTHWEST, RIGHT, SOUTH, SOUTHEAST, SOUTHSOUTHEAST, SOUTHSOUTHWEST, SOUTHWEST, UP, VERTICAL, WEST, WESTNORTHWEST, WESTSOUTHWEST |
| Constructor Summary | |
|---|---|
CompositedActionFrames(ImageManager imgr,
Map<CompositedActionFrames.CompositedFramesKey,CompositedMultiFrameImage> frameCache,
String action,
CompositedActionFrames.ComponentFrames[] sources)
Constructs a set of composited action frames with the supplied source frames and colorization configuration. |
|
| 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. |
protected CompositedMultiFrameImage |
createFrames(int orient)
Creates our underlying multi-frame image for a particular orientation. |
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. |
int |
getXOrigin(int orient,
int frameIdx)
Returns the x offset from the upper left of the image to the "origin" for this character frame. |
int |
getYOrigin(int orient,
int frameIdx)
Returns the y offset from the upper left of the image to the "origin" for this character frame. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ImageManager _imgr
protected Map<CompositedActionFrames.CompositedFramesKey,CompositedMultiFrameImage> _frameCache
protected String _action
protected int _orientCount
protected CompositedActionFrames.ComponentFrames[] _sources
protected CompositedActionFrames.CompositedFramesKey _key
| Constructor Detail |
|---|
public CompositedActionFrames(ImageManager imgr,
Map<CompositedActionFrames.CompositedFramesKey,CompositedMultiFrameImage> frameCache,
String action,
CompositedActionFrames.ComponentFrames[] sources)
| Method Detail |
|---|
public int getOrientationCount()
ActionFrames
getOrientationCount in interface ActionFramespublic TrimmedMultiFrameImage getFrames(int orient)
ActionFrames
getFrames in interface ActionFrames
public int getXOrigin(int orient,
int frameIdx)
ActionFrames
getXOrigin in interface ActionFrames
public int getYOrigin(int orient,
int frameIdx)
ActionFrames
getYOrigin in interface ActionFramespublic ActionFrames cloneColorized(Colorization[] zations)
ActionFrames
cloneColorized in interface ActionFrames
public ActionFrames cloneTranslated(int dx,
int dy)
ActionFrames
cloneTranslated in interface ActionFramesprotected CompositedMultiFrameImage createFrames(int orient)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||