Jump to content
loodakrawa

SpriterDotNet - An implementation for all C# frameworks

Recommended Posts

On 2/1/2018 at 7:07 PM, Mito said:

Hi, im new here :P

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
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.

 

Share this post


Link to post
Share on other sites

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();
}

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...