• Advertisement
Sign in to follow this  

Standard definition of sprites?

This topic is 2256 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

Is there a standard way of describing image positioning in a sprite sheet?

I hope I'm using the proper terminology, so in other words:
A lot of times a single image file will have a lot of tiny images in it. Program would use those individual images for a game/application, but it needs to know the position of those images.
Is there a standard way of describing the positions of those tiny images?
For example maybe a text file:
name:offsetx, offsety, lengthx, lengthy
or in xml:
<image name="butterfly">
<offset><x>200</x><y>100</y></offset>
<length><x>40</x><y>25</y></length>
</image>

Is there a standard file format like that?

If not, than is there a recommended way?

And finally, if not even something that's recommended, are there any personal recommendations?
Thank you
Alex

Share this post


Link to post
Share on other sites
Advertisement
I don't know if there is a standard way, but you need 4 things x, y, width, and height. I'm assuming by length x,y you mean width and height. Ideally you would have a tool that makes a binary file, that is then loaded by your game. Any file format you're comfortable with will work though. If using XML this is how I would set it up:
[code]
<sprite name="butterfly">
<!--- I wouldn't use offset here, offset suggests the animation frame is offset by an x,y from the actual sprite's x,y --->
<x>200</x>
<y>100</y>
<!--- width and height make a lot more sense than length imho --->
<width>40</width>
<height>25</height>
</sprite>
[/code]

Share this post


Link to post
Share on other sites
agreed, width+height is better, and so is the whole xml you made up.

still kind of disheartening there's no standard for something so commonly used.

Thank you

Share this post


Link to post
Share on other sites
[quote name='abeylin' timestamp='1321534628' post='4884944']
agreed, width+height is better, and so is the whole xml you made up.

still kind of disheartening there's no standard for something so commonly used.

Thank you
[/quote]

There are too many variables that are important to program specific optimization for it to be standard imo.

Share this post


Link to post
Share on other sites
[quote name='way2lazy2care' timestamp='1321537597' post='4884953']
There are too many variables that are important to program specific optimization for it to be standard imo.
[/quote]

Could you give an example, and are you discussing file-format or data in the file?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement