Jump to content

loodakrawa

Members
  • Posts

    161
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by loodakrawa

  1. I don't see why not - I suppose you could do something similar to what SpriterImporter does, just during runtime.
  2. What you're trying to achieve sounds rather complicated. I can think only of one way of doing this. I haven't done anything similar so this is just a though experiment which will hopefully point you to the right direction. I'd make the clapper as a separate entity and have a point or collision box on it. The animation would be just the vertical elongation and I'd make it as long as the max possible (screen height?). Then you animate it and detect collisions for that point/collsion box and when it collides stop the animation. The real problem is how to connect the two animations (bell and clapper). Adding it as a sub-entity doesn't really help because you need to control it independently. So I guess the only option is to add 2 points to the bell animation - one on top of the bell where the "rope" is anchored and another one somewhere below to indicate the direction of the clapper. That way you can get an angle and set the clapper position accordingly. And for hitting a wall - detect the clapper point collision with the wall and just reverse the bell animation. Hope this helps. Cheers
  3. Hi, This is definitely the correct place to ask questions First of all - If you want to know a specific location from the animation, you should probably use action points. At the moment, the point transforms are not being converted into MonoGame coordinates (since I didn't know of a use case for this) but your question made me realise there should at least be a generic method that converts transforms from Spriter to MonoGame. I'll implement that asap. If you need such a functionality in the meantime, you can take a look at the MonogameDebugAnimator. It is piggybacking on the functionality of transforming sprite coordinates to draw action points. If you run the example project and go to the 4th spriter animation ("GreyGuyPlus/player_006") you'll be able to see that in action. Cheers
  4. Hi, I'm glad to hear there's more love for MonoGame out there I'll update the MonoGame specific documentation soon since I added quite a few helpers and the documentation you're referring is the generic one (since the lib can be used with any framework). The easiest way to make it work for MonoGame is: Build the SpriterDotNet.MonoGame.Importer project Add a reference to the built .dll in MonoGame's content file for your game - something like this Instantiate a DefaultProviderFactory<Sprite, SoundEffect> Instantiate a SpriterContentLoader invoke the fill method of the SpriterContentLoader passing the factory from step 3 You can see all this in action in the example project, or in this class to be more specific. Alternatively, if you want the bare bones version (not using any caching, texture sharing, etc): Read the .scml data into a string Get a Spriter instance with SpriterReader.Default.Read Instantiate a MonoGameAnimator passing the Entity you want animated (from the Spriter in step 2) + null for factory Iterate over all SpriterFolder/SpriterFile in Spriter and load them as Texture2D/SoundEffect MonoGame types * wrap all Texture2D in a Sprite instance (like so) Register all data from step 4. with SpriteProvider/SoundProvider properties on the animator from step 3 Call Update and Draw on the animator There you go, hopefully that can get you started. All of this might sound a bit overly complicated but it comes with a bunch of optimisations out of the box and allows you to customise almost every detail. You can find more about that here. Let me know if you managed to make it work or if any steps were not clear (so I can add this to the docs). Cheers
  5. Hi! I'm also using it with MonoGame and Android so that means this mode is always actively updated - It is possible to combine multiple animations (2 atm). Just read the docs (relevant section) - You can achieve the desired behaviour by using "Action Points". Also, take a look at the MonoGame example project - it is just drawing the points but it can serve as a good example. - I don't see why not. All the transforms do get applied to bounding boxes. Also take a look at the example project - same thing. Cheers
  6. You probably created the project as 3D instead of 2D so Unity imports images as something other that Sprite. So either create this as a 2D project or change the default import type for images (I don't know if this is actually possible).
  7. And now I read this properly - no, my lib never used any additional smoothing. The goal is to have everything look as it looks in Spriter. That being said, everything in Spriter is being interpolated so technically everything should be smooth all the time.
  8. Now that I think of it - I added caching of frame data. Relevant documentation: https://github.com/loodakrawa/SpriterDotNet#providers The default implementation uses the SnapshotFrameDataProvider which means that instead of calculating the transforms for every frame, this pre-calculates the transforms for the animation with the given interval and uses the closest value when needed. The default interval is 20ms and it should result in a smooth animation but try lowering the value or using the implementation that calculates everything every frame. Let me know if you have any more questions and your results - any feedback helps improve the library. Cheers
  9. Hi, Definitely haven't experienced it - newer versions should be faster, not slower Does it happen with any other animations? Also, are you using Unity or something else?
  10. Hi, You can find the documentation here: https://github.com/loodakrawa/SpriterDotNet and here: https://github.com/loodakrawa/SpriterDotNet/tree/develop/SpriterDotNet.Unity The example just shows a simple way of using the library but the documentation covers a lot more (including the animation progress and events). Cheers
  11. No worries - I didn't get offended. I'm genuinely interested to find out if there's a better way of doing things - especially from a user's perspective. For me is hard to tell since I know the ins and outs of the library. The sprite gets refreshed every frame because sprites can appear/disappear during the animation. In some cases this might be unnecessary and can be commented out but I don't think that impacts the performance in any significant way.
  12. Yes - that is the way to do it (if you're not using character maps). What would be the most elegant way? I'm always open for improvement ideas.
  13. Hey, you can customise the import process (like setting the Is Trigger flag on colliders) via the EntityImported event. Take a look at the example.
  14. Just realised what the problem is. You're getting the SdnBehaviour with FindObjectOfType which (as per documentation) "Returns the first active loaded object of Type type." That means it probably finds the one on the Bat and that's why it blows up. https://docs.unity3d.com/ScriptReference/Object.FindObjectOfType.html What you want is: https://docs.unity3d.com/ScriptReference/GameObject.GetComponent.html
  15. It definitely should work with multiple spriter entities. I won't be near my machine with Unity installation for a couple of days to check the project. But, from your description it seems you're trying to play "hit_0" which exists on GreyGuy but not on the bat. Did you perhaps add the PlayerController to the Bat game object?
  16. Updates: Version 1.5.0 released a while ago Just finished with a massive documentation update - should be up-to-date for every plugin Released the MonoGame plugin as a NuGet package Happy coding!
  17. Yes - it's just a timing issue. Calling Step(0) is a good solution to make it independent of the order of the init methods - I'm also doing that often in my own projects.
  18. Hi, I'm glad you find it useful. Due to the nature of SpriterDotNet it's not really possible to convert everything directly into Unity Animations but the plan is to make it more integrated with Unity. For the time being, you might want to take a look at Dengar's plugin. As for animation events, Spriter supports them natively so that might give you a decent replacement for Unity animation events. And blend trees are one of the planned features. Cheers
  19. Speed - (Unity)SpriterAnimator has a Speed property Mirror - to mirror the animation, changing the scale to negative on the top level object should do the trick
  20. Hi everyone - I won't quote individual posts since they're all about spritesheets. I'm definitely planning to add support for sprite atlases but I'll first do other things. The rough roadmap is: finish the MonoGame plugin fix open bugs update the Unity plugin implement atlases implement blend trees (or an alternative) @Dengar - I think Unity supports sprite "regions" or something similar so that's how I plan to do this. I can't remember exactly how that works but I remember seeing a similar functionality already
  21. This is awesome - nice work!
  22. Hey, I prefer discussions here and bug reports / feature requests as issues on GItHub. You are right - it doesn't make much sense to have the same mapping per SpriterAnimator when it can easily be per shared. I opened a GitHub issue for this. Regarding the MonoGame example - I'm fixing the MonoGame plugin to be more like an actual plugin and not just a simple example.
  23. This was caused by a bug in the core library. I fixed it and pushed to develop branch. Thanks for reporting!
  24. Hi, Just trying to understand the issue - first you said that the data in the .asset file is correct but later you said you have to manually edit it. Could you post the relevant pieces of information? Additionally - could you upload the entire animation somewhere so I can take a look?
  25. Hi, are you perhaps trying to blend two animations with a different hierarchy? More about it here. If not, can you please upload your .scml somewhere so I can investigate this further.
×
×
  • Create New...