• entries
    500
  • comments
    1888
  • views
    333610

more.

Sign in to follow this  
EDI

88 views

Image
{
LPDIRECT3DTEXTURE8 texture;
int32 sizeX;
int32 sizeY;
};

Frame
{
Image image;
bool alphaBlend;
bool mirrorH;
bool mirrorV;
int16 anchorX;
int16 anchorY;
int16 hitL;
int16 hitT;
int16 hitR;
int16 hitB;
};

Sheet
{
int16 cellsX;
int16 cellsY;
int16 areaX;
int16 areaY;
std::vector frames;
};

Animation
{
Sheet sheet;
float fps;
int16 loops;
int16 begFrame;
int16 endFrame;
int16 track;
};

Entity
{
int16 anchorX;
int16 anchorY;
int16 track;
float frame;
Animation animation;
std::map animations;
};


So after some more thought, the above is what I have come up with.

Images, themselvs are not directly utilitized by any top-level objects. Instead a Sheet object must be defined ".sheet", a Sheet is a row/col arrangement of Images, wherin each image is contained in a Frame object, and contains information such as anchoring, and a hit-test bounding box. A sheet can then be attached to an Animation object, which defines a way to display the sheet, the simplest being a single frame. An entity defines none or more Animation objects and methods on the entity can be used to play an animation.

P.S.

Some of you might note that Sheet has two properties areaX and areaY. These values are used to describe how much 'tile area' any image in the sheet will occupy. For most things a single tile of displacement is enough, but for large tables, or things of that kind, the displacement must be set properly to allow for proper collision and drawing.
Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now