loodakrawa Posted February 9, 2018 Author Report Posted February 9, 2018 On 2/1/2018 at 7:07 PM, Mito said: Hi, im new here I have some issues (i use monogame with visual studio 2005) 1.- i Tried to import spriterdotnet.monogame 1.6.1 from nuget but when it has installed send me some errors with Monogame.framenetwork... the same thing happen with spriterdotnet.monogame.importer 1.6.1... after that i choose the 1.6 version 2.- With 1.6 version i follow the example in github but in this part SpriterContentLoader loader = new SpriterContentLoader(Content, scmlPath); loader.Fill(factory); the loader fill part send me a null error message I will be grateful if you can help me What kind of errors are you getting? Especially for the 1.6.1 version Quote
Aaike64 Posted March 3, 2018 Report Posted March 3, 2018 I´m starting a project with Libgdx and Spriter but your work sounds very interesting. Does this work with Xamarin Forms? Quote
loodakrawa Posted March 4, 2018 Author Report Posted March 4, 2018 On 3/3/2018 at 1:46 PM, Aaike64 said: I´m starting a project with Libgdx and Spriter but your work sounds very interesting. Does this work with Xamarin Forms? I have no experience with Xamarin Forms - but I don't see why not. The core library just basically crunches numbers and gives you the numbers about the required transform. You "only" need to map it to something visual - which I assume you can do with Xamarin Forms. Quote
alex2020 Posted April 10, 2018 Report Posted April 10, 2018 Hi, i´m trying to implement some kind of normal mapping in monogame. For this i have to switch the character map in the draw loop. Is this possible? It seems like i have to wait until the next update until the character map changes takes effect. I draw the player to a rendertarget, then i push a character map to the player (the normal map) and draw the player again to my normalmap-rendertarget. Then i use a shader to combine those two rendertargets. Or do you have a better idea for this? Maybe 2 player objects with different character maps, but i thinks it will be difficult to keep both in sync... Quote
loodakrawa Posted April 16, 2018 Author Report Posted April 16, 2018 On 4/11/2018 at 9:07 AM, alex2020 said: Hi, i´m trying to implement some kind of normal mapping in monogame. For this i have to switch the character map in the draw loop. Is this possible? It seems like i have to wait until the next update until the character map changes takes effect. I draw the player to a rendertarget, then i push a character map to the player (the normal map) and draw the player again to my normalmap-rendertarget. Then i use a shader to combine those two rendertargets. Or do you have a better idea for this? Maybe 2 player objects with different character maps, but i thinks it will be difficult to keep both in sync... Hey, How about implementing a custom Animator that has both the Texture and Normal data as the sprite parameter? Something like:class CustomAnimator : Animator<TextureNormal, SoundEffect> With TextureNormal being some kind of datastructure that has both your texture and normal data. That way you can draw both with one loop. Quote
Aaike64 Posted September 14, 2018 Report Posted September 14, 2018 Hello there, any implementation with skiaSharp? Quote
sabi04 Posted January 12, 2019 Report Posted January 12, 2019 Hi Sorry English is short. SpriterDotNet, SpriterDotNet.MonoGame All version 1.6.1.0 nuget error can not be installed So install as source monogame v 3.7.1 android works well IOS error Error loader.Fill (factory) I saw something in the error Microsoft.Xna.Framework.Content.ContentLoadException: Could not find ContentTypeReader Type. Please ensure the name of the assembly contains the type of assembly in the full type name: SpriterDotNet.MonoGame.Content.SpriterTypeReader, SpriterDotNet.MonoGame, Version = 1.6.1.0, Culture = neutral, PublicKeyToken = null (SpriterDotNet.MonoGame. Content.SpriterTypeReader, SpriterDotNet.MonoGame) How do I do this? Quote
sabi04 Posted January 15, 2019 Report Posted January 15, 2019 On 1/13/2019 at 12:19 AM, sabi04 said: Hi Sorry English is short. SpriterDotNet, SpriterDotNet.MonoGame All version 1.6.1.0 nuget error can not be installed So install as source monogame v 3.7.1 android works well IOS error Error loader.Fill (factory) I saw something in the error Microsoft.Xna.Framework.Content.ContentLoadException: Could not find ContentTypeReader Type. Please ensure the name of the assembly contains the type of assembly in the full type name: SpriterDotNet.MonoGame.Content.SpriterTypeReader, SpriterDotNet.MonoGame, Version = 1.6.1.0, Culture = neutral, PublicKeyToken = null (SpriterDotNet.MonoGame. Content.SpriterTypeReader, SpriterDotNet.MonoGame) How do I do this? This is my mistake. It looks like Link all the assemblies are set in the link option. Quote
alex2020 Posted January 23, 2019 Report Posted January 23, 2019 Hi i wrote a class for script processing (for the tags and variables) but i don´t want it to run on every update. Is there a way to check if the frame is a keyframe ? like: // pseudocode: if (animator->isKeyframe()){ doMyScript(); } Quote
loodakrawa Posted January 24, 2019 Author Report Posted January 24, 2019 12 hours ago, alex2020 said: Hi i wrote a class for script processing (for the tags and variables) but i don´t want it to run on every update. Is there a way to check if the frame is a keyframe ? like: // pseudocode: if (animator->isKeyframe()){ doMyScript(); } Well, there's nothing built-in if that's what you're asking. Key frames are not special in regards to the actual animation, especially since you can advance the simulation with any delta time which can cause the current frame to never land exactly on a keyframe. That being said, you can probably achieve it by inspecting the keyframe times yourself via animator->Entity->CurrentAnimation->etc and keeping track when you pass a keyframe. Alternatively you can add events to the animation and subscribe via the Animator->EventTriggered event. Quote
alex2020 Posted February 2, 2019 Report Posted February 2, 2019 ok for simplicity i skipped the "only per key frame check" and check for variables and tags in every update loop. But i found another problem. In my landFromJump animation i placed a variable (setNextAnimation = idle) at the last frame. Its never reached because of the delta time. If i place a variable or tag at the last 17 frames of the animation its never reached. (1000 frames / 60 fps => 16.6 frames) If i place it before frame 982 its working fine. if (animator.FrameData.AnimationVars.ContainsKey("setNextAnimation")) { if (animator.FrameData.AnimationVars["setNextAnimation"].StringValue != "") { string nextAnimation = animator.FrameData.AnimationVars["setNextAnimation"].StringValue; animator.Transition(nextAnimation, 0.5f); } } I tried the AnimationFinished Event but it don´t know the variables either if i place them on the last frames. Quote
JuanGdC Posted April 15, 2019 Report Posted April 15, 2019 Hey @loodakrawa , Great job. Just one question, what would be the main differences with @Dengar´s implementation (https://github.com/Dharengo/Spriter2UnityDX) regarding Unity? EDIT: Btw the .NET Standard 2.0 is avaible in Unity now Quote
Mike at BrashMonkey Posted April 15, 2019 Report Posted April 15, 2019 Spriter2Unity converts a Spriter file into native Unity format, SpriterDotNet for Unity keeps it Spriter format and therefore supports much more of the advanced features, but requires a higher learning curve. Quote
JuanGdC Posted April 16, 2019 Report Posted April 16, 2019 Played with both solutions yesterday SpriterDotNet was able to import everything semlessly, whereas Spriter2Unity struggled with some of the animations. I ended up using SpriterDontNet but the lack of integration with Unity´s animator seemed like a huge throwback (I love state machines). That is the reason why I coded a simple solution that integrates SpriterDotNet with Unity´s animator, you cannot modify the animations in Unity but you can use the animator as you would do with regular animations. A self-explanatory video: PD: Be sure to turn on the subtitles Quote
mathetis Posted April 16, 2019 Report Posted April 16, 2019 Is there an example of using subentities with Spriter.NET? Thank you. Quote
sds_alex Posted December 8, 2019 Report Posted December 8, 2019 Heya folks, I have a question about how best to approach something. I set up per pixel collision detection by looping through the sprite data for the current frame (animator.FrameData.SpriteData), converting the in-game collision test position to a texture coordinate and then checking for the opacity of the pixel at that location on the texture, but I'm having trouble figuring out which bone corresponds to the sprite that was collided with. My intention is to set it up so that certain bones take more damage when hit. So far the best idea I've come up with is to set up both per pixel collision detection to accurately detect that a collision occurred, as well as a bounding box for specific collision zones to determine where the hit occurred, but that seems messier than would be ideal and wouldn't let me mark certain bones to be ignored by the per pixel collision detection. Is there a better way to approach what I'm trying to do here? Is there a way to loop through the bones currently being drawn rather than the sprites that would let me determine which bone has the sprite attached that is receiving a collision? Quote
sds_alex Posted December 10, 2019 Report Posted December 10, 2019 I pretty much solved my own problem, but in case other folks want to go down this path in the future: From what I gather, the animator.FrameData.SpriteData contains objects that represent the information about the way a sprite needs to be positioned and drawn. It doesn't seem to contain a reference to the name of the bone that it is attached to by default. I edited the SpriterDotNet API to add a string variable named BoneName to the SpriterObject class in the SpriterModel.cs file, and then added "info.BoneName = timeline.Name;" to the top of the AddSpatialData method in the FrameDataCalculator class. This allows me to retrieve the BoneName from a SpriterObject. Mike at BrashMonkey 1 Quote
sds_alex Posted January 4, 2020 Report Posted January 4, 2020 Does this implementation support "transitioning" from the current state of an animation to the starting state of the same animation? I have an attack animation, and I want to "transition" from the ending state of the animation to the beginning state of the next animation, but it seems to bug out. If I replace the Transition calls with Play it works, but of course without the transition. Quote
sds_alex Posted January 5, 2020 Report Posted January 5, 2020 Ran into another issue, curious if anyone has any tips. I was having trouble syncing up a walk cycle with the creatures movement because I was getting an odd inconsistent jitter. After investigating the issue, it seems that every time a bone hits a keyframe, it freezes for a frame. Is this intended, or is there some kind of workaround? It isn't noticeable normally, but it is noticeable in situations where you're trying to seamlessly sync movement to an animation. Quote
sds_alex Posted January 8, 2020 Report Posted January 8, 2020 On 1/5/2020 at 4:25 AM, sds_alex said: Ran into another issue, curious if anyone has any tips. I was having trouble syncing up a walk cycle with the creatures movement because I was getting an odd inconsistent jitter. After investigating the issue, it seems that every time a bone hits a keyframe, it freezes for a frame. Is this intended, or is there some kind of workaround? It isn't noticeable normally, but it is noticeable in situations where you're trying to seamlessly sync movement to an animation. In case anyone runs into this in the future, ultimately the issue boiled down to the pre-cached interpolated frames, and disabling pre-cacheing stopped the problem. Quote
sds_alex Posted January 25, 2020 Report Posted January 25, 2020 Does anyone have any clue why adding a string metadata to an event causes the scml file to fail to load? It tells me that the file can't be found when I use Spriter = LoadContent<Spriter>(scmlPath); (it just returns null and outputs something about not finding the file in the console) I can add metadata to bones fine, but for some reason it refuses to load if there is a metadata variable attached to an event. Quote
Bojan Novakovic Posted October 21, 2024 Report Posted October 21, 2024 Video tutorial for MonoGame in case anyone needs it Mike at BrashMonkey 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.