home |  downloads |  help  |  forum  |  contact us 
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2013, 07:33:19 AM

Login with username, password and session length
Search:     Advanced search
fragMOTION 1.2.2 Released!
2787 Posts in 689 Topics by 789 Members
Latest Member: seanfisher7886
* Home Help Search Login Register
+  Fragmosoft Forum
|-+  fragMOTION
| |-+  General Discussion
| | |-+  Generated sprites are incorrectly positioned
« previous next »
Pages: [1] Go Down Print
Author Topic: Generated sprites are incorrectly positioned  (Read 660 times)
retrothomas
Newbie
**
Posts: 12


View Profile
Generated sprites are incorrectly positioned
« on: March 11, 2011, 04:44:44 PM »

When I use the sprite creation feature my sprites don't come out centered or positioned properly. I've tried to think of anything I'm doing that could be causing the problem but I think fragMOTION is causing the issue.

I attached an example image. Notice that the sprites are not in a uniform grid so as to be usable within my game engine; instead, they are variable widths and the character's height is different in each image due to the pointy hat. I checked and the character is properly positioned at the origin point.

I otherwise am in love with the feature but it's not giving me useable sprites this way. Any idea how can I export the sprites so that they are positioned in a proper grid with the character being centered, rather than put into different spots? I tried different row/column/grid options as well as with the "uniform sizing" button checked and unchecked.

Thanks in advance! Smiley

* test.png (34.73 KB - downloaded 8 times.)
Logged
fragmo
Administrator
Not A Newbie
*****
Posts: 10664



View Profile
Re: Generated sprites are incorrectly positioned
« Reply #1 on: March 12, 2011, 10:07:31 AM »

Create a bone and attachment named origin at (0,0,0).  When you save the sprite bitmap there is also an xml file exported that gives the size and location of each cell and the origin of all attachments for each of the bitmap cells.  You'll either need to create a utility to modify the bitmaps to suit your needs or do it by hand.  If you describe how your game engine expects the sprite bitmaps to be arranged I might be able to add some features to accommodate you in a future version. 

dave
Logged
retrothomas
Newbie
**
Posts: 12


View Profile
Re: Generated sprites are incorrectly positioned
« Reply #2 on: March 12, 2011, 10:29:57 AM »

Thank you for your reply. To clarify, you want me to create the bone and attachment within fragMOTION? Any tips on what steps I need to do in order to do that? Until now I was only using the export utility. Thanks again Smiley
Logged
fragmo
Administrator
Not A Newbie
*****
Posts: 10664



View Profile
Re: Generated sprites are incorrectly positioned
« Reply #3 on: March 12, 2011, 10:44:10 AM »

Go to the skeleton pane, right click on 'skeleton', click new -> bone.  Right click on the newly created bone, click new -> attachment.  Right click the newly created attachment, click 'rename'.  Change the name to 'origin'.   Now when you export your sprite there will be a 'point' named 'origin' on each frame of animation in the exported xml file.  This point will tell you where the origin of the model (usually where the feet are) is located on each sprite bitmap.
Logged
retrothomas
Newbie
**
Posts: 12


View Profile
Re: Generated sprites are incorrectly positioned
« Reply #4 on: March 12, 2011, 10:57:09 AM »

That put the information in the XML file. I'll tinker with it and see if I can get it looking right in my game engine. It looks like this will work out, though. Thank you very much!
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Fragmosoft Forum | Powered by SMF 1.0.8.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!