Spriter importer and collision or getting objects
Monkey Forums/Monkey Programming/Spriter importer and collision or getting objects
| ||
I am playing around with this again and I would like to add some kind of collision handling. What is the best way to get a certain part of the sprite. For example the sword relative x and coordinates, width and height so can make some collision stuff? Also the complete width and height of a sprite would be great :) Or I should hack something together myself... I have made this little demo with Spriter importer and Ignition: http://www.playniax.com/share/demos/spriter/MonkeyGame.html |
| ||
The complete width/height of a sprite is a bit tricky but we should be able to calculate it somehow. RE: Getting objects, I've been meaning to add something like what Slotman did over on bb.com: http://www.blitzbasic.com/Community/post.php?topic=99983&post=1177496 Collision data is meant to come in a future version of Spriter, but we should be able to get the each objects location, width and height and do at least a bounding box collision check. |
| ||
Okay, I am going to take a look. If I know the width /height of all objects and the relative positions it's not so hard to calculate the complete width/height. I did this with my scrollbox :) |
| ||
If I know the width /height of all objects and the relative positions it's not so hard to calculate the complete width/height. But what about rotation and scale of the objects, since these can be changed during the animation... it depends on if you want a rough size or a size at a set point in the animation. |
| ||
Ah yes, rotation can make it tricky ;) For me would be more interesting to get the individual objects width/height/scale/rotation and relative pos to have some kind of collision handling then. |
| ||
Any progress on this? |
| ||
I am. Yesterday I just developed a way to change "objects", or even attaching one to another... shame I can't post everything, since it's tied to custom libs I'm developing under contract :( But I think it's ok to post this, should help people out: You could have another function that solves filenames into folder/file ints and then you can manipulate spriter objects all you want :) Reading this thread was a nice reminder that I need to make some bounding box/bounding sphere generator for spriter animations :) |
| ||
Hey Slotman, would you like access to the repo, so if you want you can commit changes/fixes? |
| ||
Thanks, but: - I have no idea how to use git - I'm under contract, so most of my code can't be shared :( - I'm still using a really old version of the importer, one that doesn't even have bones! And one thing I couldn't "fix" so far: when I attach an image into another, it's moving around just "a little bit" (seems to be less than a pixel?) during the animation. It's nothing too distracting (specially at 1x zoom), but does shows that it's an object on top of another :/ |
| ||
- I have no idea how to use git I dont like Git, I use Hg :) - I'm under contract, so most of my code can't be shared :( Fair enough.. offers there to you and anyone else :) - I'm still using a really old version of the importer, one that doesn't even have bones! Any reason why? |
| ||
Any reason why? Nothing particular... I just started working on that, and now I have way too much stuff built on top of it ^_^ |