Altered character animations to separate standing image from walking

animation images.  Created and made use of basic single- and
multi-image implementations of the MultiFrameImage interface.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@559 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2001-10-25 18:06:17 +00:00
parent 4b58a696ca
commit 95d6896ef7
5 changed files with 136 additions and 57 deletions
@@ -0,0 +1,37 @@
//
// $Id: MultiFrameImageImpl.java,v 1.1 2001/10/25 18:06:17 shaper Exp $
package com.threerings.media.sprite;
import java.awt.Image;
/**
* A basic implementation of the {@link MultiFrameImage} interface
* intended to facilitate the creation of sprites whose display frames
* consist of multiple image objects.
*/
public class MultiFrameImageImpl implements MultiFrameImage
{
/**
* Constructs a multiple frame image object.
*/
public MultiFrameImageImpl (Image imgs[])
{
_imgs = imgs;
}
// documentation inherited
public int getFrameCount ()
{
return _imgs.length;
}
// documentation inherited
public Image getFrame (int index)
{
return _imgs[index];
}
/** The frame images. */
protected Image _imgs[];
}
@@ -0,0 +1,38 @@
//
// $Id: SingleFrameImageImpl.java,v 1.1 2001/10/25 18:06:17 shaper Exp $
package com.threerings.media.sprite;
import java.awt.Image;
/**
* The single frame image class is a basic implementation of the
* {@link MultiFrameImage} interface intended to facilitate the
* creation of sprites whose display frames consist of only a single
* image.
*/
public class SingleFrameImageImpl implements MultiFrameImage
{
/**
* Constructs a single frame image object.
*/
public SingleFrameImageImpl (Image img)
{
_img = img;
}
// documentation inherited
public int getFrameCount ()
{
return 1;
}
// documentation inherited
public Image getFrame (int index)
{
return _img;
}
/** The frame image. */
protected Image _img;
}