Jump to content

Understanding the sprite sheets


catmorbid

Recommended Posts

I've been trying to work out how to add simple animated particles/projectiles, and there's some things I don't understand regarding the .xml file used for the sprite sheet.

Let's take for example the particle greysmoke:

<sequence name="particles/greysmoke/greysmoke.xml" source="./smoke*.png">   <img regx="46" regy="71" name="greysmoke" w="0" h="0" />   <framelist>       <frame regx="47" regy="99" x="191" y="381" w="92" h="126" name="smoke0000.png" xform="1.000000 0.000000 0.000000 1.000000 0.000000 0.000000" />       <frame regx="47" regy="99" x="191" y="508" w="92" h="126" name="smoke0001.png" xform="1 0 0 1 0 0" />       <frame regx="48" regy="99" x="381" y="127" w="93" h="126" name="smoke0002.png" />       <frame regx="48" regy="99" x="475" y="127" w="93" h="126" name="smoke0003.png" />       <frame regx="47" regy="99" x="285" y="254" w="92" h="126" name="smoke0004.png" />       <frame regx="48" regy="99" x="191" y="254" w="93" h="126" name="smoke0005.png" />       <frame regx="48" regy="98" x="475" y="381" w="93" h="125" name="smoke0006.png" />       <frame regx="49" regy="98" x="378" y="254" w="94" h="125" name="smoke0007.png" />       <frame regx="48" regy="98" x="475" y="507" w="93" h="125" name="smoke0008.png" />       <frame regx="49" regy="98" x="473" y="254" w="94" h="125" name="smoke0009.png" />       <frame regx="49" regy="99" x="192" y="0" w="94" h="126" name="smoke0010.png" />       <frame regx="49" regy="98" x="285" y="381" w="94" h="125" name="smoke0011.png" />       <frame regx="49" regy="99" x="287" y="0" w="94" h="126" name="smoke0012.png" />       <frame regx="49" regy="98" x="285" y="507" w="94" h="125" name="smoke0013.png" />       <frame regx="49" regy="98" x="380" y="381" w="94" h="125" name="smoke0014.png" />       <frame regx="49" regy="98" x="380" y="507" w="94" h="125" name="smoke0015.png" />       <frame regx="49" regy="99" x="382" y="0" w="94" h="126" name="smoke0016.png" />       <frame regx="49" regy="99" x="477" y="0" w="94" h="126" name="smoke0017.png" />       <frame regx="49" regy="99" x="96" y="127" w="94" h="126" name="smoke0018.png" />       <frame regx="49" regy="99" x="96" y="254" w="94" h="126" name="smoke0019.png" />       <frame regx="49" regy="99" x="96" y="381" w="94" h="126" name="smoke0020.png" />       <frame regx="50" regy="99" x="0" y="0" w="95" h="126" name="smoke0021.png" />       <frame regx="50" regy="99" x="0" y="127" w="95" h="126" name="smoke0022.png" />       <frame regx="50" regy="99" x="0" y="254" w="95" h="126" name="smoke0023.png" />       <frame regx="50" regy="99" x="0" y="381" w="95" h="126" name="smoke0024.png" />       <frame regx="50" regy="99" x="0" y="508" w="95" h="126" name="smoke0025.png" />       <frame regx="50" regy="99" x="96" y="0" w="95" h="126" name="smoke0026.png" />       <frame regx="49" regy="99" x="96" y="508" w="94" h="126" name="smoke0027.png" />       <frame regx="49" regy="99" x="191" y="127" w="94" h="126" name="smoke0028.png" />       <frame regx="49" regy="99" x="286" y="127" w="94" h="126" name="smoke0029.png" />   </framelist>

Can someone explain what regx and regy do? the x and y seem to be the actual x and y coordinates for the sprite (probably top left) and together with height (h) and width(w) you reasonably have the area around the sprite. But the regx, regy and xform are a mystery to me. If someone has figured this out, I'd appreciate it :) I know how to get the actual atlas together, I just need to know how to set up the configuration file :)

Link to comment
Share on other sites

I believe that regx and regy are registration points of each sprite. (It will take me sometime to right more detail explanation since I am struggling to find words and terms).Nah If I try to explain with my own words it will just get you confused,here is copy/paste explanation from my digital book:

What is a registration point? Do you know what I am talking about? Simply put, a registration point is the default location of an object from which an object's x and y co-ordinates are determined. More simply, it is the crosshair that appears in the center or corners of your object after you convert it into a movie clip, graphic, or button. .
Edited by Sentelin
Link to comment
Share on other sites

To expand on Sentelin's comments. regx and regy mark the reference point on the ground combat tile where your smoke will appear. x and y are the lookup point for your particle effect in the spritesheet.

EDIT: Assassinated by the op!

Edited by Max_Caine
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...