• Runtimes
  • how can i replace current inited SpinePlayer skeleton

kc-learn

The Spine Player is not designed to handle on-the-fly changes to the displayed skeleton without disposing of the player.

The easiest solution is to replace the current spine player. Have a look at this example.
Just pass the assets location to the createPlayer function.

Does this solution fits your needs?

    Related Discussions
    ...

    Davide thank you answer, i actually use that solution in my project, people click switch buttom, make player dispose and initialization frequently, in mobiel web side,it make my phone so hot, I wonder if there is a problem with content leakage, can i re-implementation with spine-webgl avoid this performance issue.i want some high performance practice

      kc-learn

      The dispose function actually disposes everything was initialized by the player. If there was a memory leak, the result would be more likely a page crash.

      Can you link or share your project so that I can have a look at your setup? If you don't want to share it publicly, you can send it to contact@esotericsoftware.com.

        Davide
        I used the browser performance analysis, found that because I draw the graph is too big, the bigger the graph, the more awkward, there is a loss of recorded frames, like the following picture, is there any way to optimize

        The spine player sits into the given HTMLElement and no overflow should happen. If it overflows, maybe there something wrong with your setup.
        You shouldn't look at the size of what's inside the webgl canvas since it depends on the devicePixelRatio.

          Davide
          I want to show only the middle area on the premise of ensuring the proportion of animation size. How can I cut and optimize, I find that the bigger the animation of the painting, the more serious the phone hot phenomenon

            kc-learn

            Unfortunately, you can't achieve that with the spine-player. You could modify the code and get that result, but it might not be the easier thing to do. If you want to try that, you have to modify spine-webgl since spine-player uses it.

            This might be a interesting use case for our work in progress spine-widget. It basically uses a single webgl context to render multiple skeletons. And you can clip the viewport at your desired bounds.
            You can give it a try by switching to the ts-webgl-overlay branch of our repository and learn how to use it launching the webcomponent-tutorial example.

              Davide
              So I really need to learn spine-webgl, which can help me understand the basic logic of the entire runtime. I am curious about whether spine-play has done performance test on mobile terminals. When drawing animations close to the full screen, the hot phenomenon makes me worry that old mobile phones cannot be well compatible (thank you answer again)

                kc-learn

                Before deep diving into spine-webgl, I really encourage you to try the spine-widget mentioned above since it already does what you want. You can actually see the tutorial here.

                  Davide I did not find the source code for spine-widget :

                    kc-learn

                    As mentioned yesterday, you can get it by switching to the ts-webgl-overlay. Then you can build it by yourseld. Its source is in the spine-webgl folder right now.
                    But I suggest you to just directly download the library from the page I linked yesterday.

                      7 jours plus tard

                      Davide oh my mistake,i have found the example i need,thank you !