Added the ability to add translations on a per-component-instance basis.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@160 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Andrzej Kapolka
2007-02-28 21:51:47 +00:00
parent dc4b721198
commit 6e7b1741ff
7 changed files with 170 additions and 83 deletions
@@ -48,13 +48,13 @@ public class CompositedActionFrames
public ComponentFrames () {
}
public ComponentFrames (
CharacterComponent ccomp, ActionFrames frames) {
this.ccomp = ccomp;
this.frames = frames;
}
public String toString () {
return ccomp + ":" + frames;
}
@@ -127,6 +127,17 @@ public class CompositedActionFrames
throw new RuntimeException("What you talkin' about Willis?");
}
// documentation inherited from interface
public ActionFrames cloneTranslated (int dx, int dy)
{
ComponentFrames[] tsources = new ComponentFrames[_sources.length];
for (int ii = 0; ii < _sources.length; ii++) {
tsources[ii] = new ComponentFrames(
_sources[ii].ccomp, _sources[ii].frames.cloneTranslated(dx, dy));
}
return new CompositedActionFrames(_imgr, _frameCache, _action, tsources);
}
/**
* Creates our underlying multi-frame image for a particular orientation.
*/