• Runtimes
  • Unable to load spine fils using Spine Web Player

RaenonX

First of all thanks for noticing the version mismatch! We're going to release a 4.0.29 version without this problem.

  1. With React strict mode on, it will load the player quite quickly then dispose it before it even ends. If it's possible to keep this on without doing some hacks to not running the useEffect() twice, it'll be great.

That's a deliberate behaviour of react in development mode to make developers aware of possible risks due to effects running twice. If you care about the possibility that the effect is called twice (that might happen also in production for any reason!), you should react to your effect called twice to avoid it to make side effects twice.
It's something we cannot solve on our side since you are basically calling twice the player constructor. That's something legitimate to do.

  1. Is there any anti-aliasing going on? Left side is using pixi-spine and right side is using spine-player. There's an obvious difference on the head of the character. Left side should be how it looks like.

That seems to me a pma problem. Do you have premultipliedAlpha set to false?

  1. Based on what actually renders in the game and what's inside the png file, there should be an antenna-like object to render. But neither pixi-spine nor spine-player have been able to render it. I thought Spine Web Player would be able to render it, that's why I am giving Spine Web Player a try. May I know what am I missing here?

I guess you did not make the animation. The asset you provide has two skins male and female.
Set the player config skin to the skin you want to activate to make the antennas appear.
The antennas are part of the skin.

  1. Is there anyway to remove that large "Spine" marking? Even if reducing it to the size to about 20px tall at the right bottom is fine...It's just too big and the demo website with controls doesn't even have it, if the control is not shown.

There should not be any marking, if you imported correctly the css within the package. I guess that logo is shown because a css class that sizes and hides it is not found.

Related Discussions
...

We have just published the 4.0.29 version that fixes the version mismatch issue 🙂

Hi,
Thanks for the quick action on fixing the version mismatch!
Regarding 1., I am aware of strict mode calling useEffect() getting called twice and know that it's intentional. My point was that since it's quickly doing construct -> dispose -> construct under strict mode, it seems like the error was because when dispose() was called, the loading mark wasn't even loaded, eventually causing dispose() getting called on a null object. I know that calling the constructor twice is completely possible (making 2 animations showing on the same page is one of the cases), but allowing quick construct -> dispose -> construct might be something worth addressing?

You should react to your effect called twice to avoid it to make side effects twice.

I have a hacky custom useEffect hook that would do so, but I feel like allowing disposal even before loading mark shows up shouldn't cause any error. It's fine if you think it should still give error though! I can just use my own custom useEffect so it only trigger the effect once in strict mode.

pma problem (...)

I didn't supply any value so it should be whatever value (likely true) by default. Specifying false gives me roundy head of the character. Thanks!

I guess you did not make the animation.

Yes, I am not the maker of the animation. Didn't know that there's a "skin" setting exists. Thanks! On top of that, Calling player.skeleton.data.skins gives me what skins are available.

css within the package

That's exactly the missing piece, thanks!


Hopefully last (batch of) question(s)

  1. Is the typing of SpinePlayerConfig for v4.0 is correct? All config options are marked as required, so something like this fails the TypeScript check.
  2. How to automatically starts playing the animation when showControls is false? The following code snippet doesn't start the animation automatically, only if showControls of the player config is false:
    success: (player) => player.play()

I want to express the gratitude of your responsiveness, thank you for being so responsive!

Sorry again. I really wish I could delete my response after finding the issue.
Typing issue, and the behavior under strict mode are the only things left!

    9 jours plus tard

    RaenonX

    Sorry for the late reply, I was in a one week vacation. I read again your previous messagges about the problem on strict mode. The error you mention on the on dispose() failing due to the LoadingScreen not yet initialized was solved from 4.1 version of the runtime.

    The same happens for the ts definition of the player configuration. From 4.1, we defined optional configuration parameters as optional.

    I highly recommend you to upgrade your animation to at least 4.1. 4.0 is more than 2 years old and we don't port all fixes to previous versions.

    Hi Davide,
    Hope you had a great vacation and thanks for responding as always!

    Is it fine if I submit PR instead so you guys can patch it? I understand that due to the maintenance effort needed, it's not possible port all fixes to old versions.

      RaenonX

      Thanks, vacation was great in the center of Italy 🙂

      Sure, PR are always welcome!
      Just try to make it as similar as possible to the latest version.

        Great, thank you for this.
        I'll merge it and make a release later today. 👍

        No problem and thanks!

          RaenonX

          I've merge it and released 4.0.30. Thanks again 🙂

          Thanks for all your help as well!