Nate

We've created a player that can easily be embedded on any web page to show your Spine animations! It looks like this:

Check out this blog post for more info:
Blog: Spine Web Player released

Read the documentation here:
Spine Web Player

You can't use the Spine Web Player on the forum yet, but you will be able to in the future!

To show how it works, the HTML and JavaScript for the player above is:
<!-- Include the JavaScript and CSS files -->
<script src="https://esotericsoftware.com/files/spine-player/3.7/spine-player.js"></script>
<link rel="stylesheet" href="https://esotericsoftware.com/files/spine-player/3.7/spine-player.css">

<!-- Create a container element -->
<div id="player"></div>

<!-- Create the player with your settings and container ID -->
<script>
new spine.SpinePlayer("player", {
jsonUrl: "https://esotericsoftware.com/files/examples/raptor/export/raptor-pro.json",
atlasUrl: "https://esotericsoftware.com/files/examples/raptor/export/raptor-pma.atlas",
animation: "walk",
backgroundColor: "#cccccc",
});
</script>
头像
Nate

Nate
帖子: 8644

Zimbres

Hi there!

Just to be sure, it's ok to place 3 players on the same page? I would like to insert some animations on a website, it is ok?
Zimbres
帖子: 5

Nate

@Zimbres, yes 3 should be fine. I believe 4 is also fine, but after that mobile browsers may not render more canvases. IIRC desktop browsers have a slightly higher limit to the number of canvases they will render at once. However, you can get clever and remove canvases that are off screen. For example, that is how our demos page is able to have 11 canvases:
Spine: Demos
头像
Nate

Nate
帖子: 8644

Zimbres

Thanks @Nate! I've purchased a license moments ago. And thanks again for the tip!
Zimbres
帖子: 5


回到 Spine