🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

more.

posted in A Keyboard and the Truth for project 96 Mill
Published November 29, 2005
Advertisement
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.
Previous Entry Animation.
Next Entry Usage Control
0 likes 1 comments

Comments

Laz
the [ code ] and/or [ source ] tags are your friend =D
November 29, 2005 10:35 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement