Jump to content

  • Log In with Google      Sign In   
  • Create Account


Standard definition of sprites?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 abeylin   Members   -  Reputation: 218

Like
0Likes
Like

Posted 16 November 2011 - 04:24 PM

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

http://www.mildspring.com - developing android games


Sponsor:

#2 firstelder_d   Members   -  Reputation: 151

Like
1Likes
Like

Posted 16 November 2011 - 07:27 PM

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:
<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>


#3 abeylin   Members   -  Reputation: 218

Like
0Likes
Like

Posted 17 November 2011 - 06:57 AM

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

http://www.mildspring.com - developing android games


#4 way2lazy2care   Members   -  Reputation: 782

Like
0Likes
Like

Posted 17 November 2011 - 07:46 AM

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


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

#5 abeylin   Members   -  Reputation: 218

Like
0Likes
Like

Posted 17 November 2011 - 03:39 PM

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


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

http://www.mildspring.com - developing android games





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS