-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regarding the creation of bounding boxes, and collision boxes. #111
Comments
Okay so I've just looked through the .scml information and it does provide an actual width and height there. How could we access this information from this library? I would then only need to apply the animator.scale to it and use the GetBoundingBox function.
If I could get this information the "w" and "h" as well as the "name" I could do all of this using the provided GetBoundingBox function, as opposed to the one I made myself. Something like |
I'm back. I've done a little bit of digging and I've managed to retrieve the object information that I was wondering about above. The only issue is that in this information the 'id' is set to 0. So I am not sure how to (cross reference, is that the word?) the object data retrieved by name, with the information within the frame data.
|
Okay, so currently the hacky workaround is to add a name field to "SpriterObject"
Then within the "AddSpatialData" function set the name.
An example code would then be:
I don't understand why there's no other way to cross reference the frame data with the object data. The ids are always set to zero for some reason. |
Updated example code to map all boxes by their name. FrameDataCalculator.cs
Entity.cs
|
The following question feels insufficiently answered as well as insufficiently documented: #80
What do we pass to the width and height as arguments provided we're talking about collision boxes?
I don't know how to get the width and height information for the object
box
. In Spriter Pro itself it also only provides a scale. What is the size the boxes are scaled from? Maybe I am not well informed enough about how Spriter Pro works and that's why I am so confused.I do know how to get this information for textures. That is simply the actual size of the image.
The following code is how I managed to get the information from the sprites that are being drawn - as you can see I can just multiply the scale of the animation to the size of the textures - however, I don't know where to find the 'size' of the box.
The text was updated successfully, but these errors were encountered: