sprite sheets
Posted: Tue Oct 13, 2009 1:18 am
I am curious to know what you all think about method's for implementing spritesheet's. I am working on implementing sprite sheet's into my "engine" and I was doing some research about the best ways of storing coordinates in sprites.
First of all, there are different kinds of spritesheet's. Well, sort of. What I was thinking is if you have a "character" or "person" or something that itself has lots of different animations but are all the same size, you could just take the size of the image, and calculate out how many frames there are based on your bpp value. This is assuming of course that you always put the run animations (same number of frames for running for every sprite) in the same spot in every sprite sheet. Etc... This to me seems very, limited. I was also thinking for things like environmental sprite sheet's this would be impossible. Especially if you had different sized sprites in your sprite sheet.
I was also reading you could have a sort-of meta file for each sprite sheet. I think, that this would be the best approach. Parse the header file in binary mode and you could store everything you need about the sprite sheet. Thing is, you have to generate this "meta" file for each sprite sheet. Is this normally how it is done? Separate files that contain the data for sprite sheet's?
I've also been following TruFun's videos, and I saw him using xml files for storing maps and it got me thinking I could use this "xml" file format for the metadata I need.
Being honest, I've never dealt with xml files, so I don't know anything specific about them, but maybe somebody here does.
I won't have anytime to work on this until the weekend, but I am curious to know everyone's thoughts. How do you guys handle spritesheet's? Is xml a good format for storing the metadata?
First of all, there are different kinds of spritesheet's. Well, sort of. What I was thinking is if you have a "character" or "person" or something that itself has lots of different animations but are all the same size, you could just take the size of the image, and calculate out how many frames there are based on your bpp value. This is assuming of course that you always put the run animations (same number of frames for running for every sprite) in the same spot in every sprite sheet. Etc... This to me seems very, limited. I was also thinking for things like environmental sprite sheet's this would be impossible. Especially if you had different sized sprites in your sprite sheet.
I was also reading you could have a sort-of meta file for each sprite sheet. I think, that this would be the best approach. Parse the header file in binary mode and you could store everything you need about the sprite sheet. Thing is, you have to generate this "meta" file for each sprite sheet. Is this normally how it is done? Separate files that contain the data for sprite sheet's?
I've also been following TruFun's videos, and I saw him using xml files for storing maps and it got me thinking I could use this "xml" file format for the metadata I need.
Being honest, I've never dealt with xml files, so I don't know anything specific about them, but maybe somebody here does.
I won't have anytime to work on this until the weekend, but I am curious to know everyone's thoughts. How do you guys handle spritesheet's? Is xml a good format for storing the metadata?