[ts][canvas] Improve examples

This commit is contained in:
Mario Zechner 2022-03-14 11:29:21 +01:00
parent 3ca76acdca
commit 6d4b8e68bc
2 changed files with 5 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<script src="../dist/iife/spine-canvas.js"></script>
</head>
<body style="margin: 0; padding: 0;">
<body style="margin: 0; padding: 0; background: #333">
<canvas id="canvas" style="width: 100%; height: 100vh;"></canvas>
</body>
@ -45,6 +45,9 @@
animationStateData.defaultMix = 0.2;
animationState = new spine.AnimationState(animationStateData);
// Set the run animation, looping.
animationState.setAnimation(0, "run", true);
// Start rendering.
requestAnimationFrame(render);
}

View File

@ -6,7 +6,7 @@
<script src="../dist/iife/spine-canvas.js"></script>
</head>
<body style="margin: 0; padding: 0;">
<body style="margin: 0; padding: 0; background: #333">
<canvas id="canvas" style="width: 100%; height: 100vh;"></canvas>
</body>