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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user