xSaber

how to zoom into my skeleton without use viewport, like a zoom button
xSaber
  • 記事: 12

Nate

You would need to write the code to do this yourself. You can look at the spine-player source code. You will need to understand how the camera works.
アバター
Nate

Nate
  • 記事: 11849

Mario

I've added a very basic CameraController that allows zooming and paning, both on desktop and mobile:
https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-ts/spine-webgl/src/CameraController.ts

You can set it up in the success callback of the player config:
https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-ts/spine-player/src/Player.ts#L144

Something like:
let config = {
success: (player) => {
let cameraController = new spine.CameraController(player.canvas, player.sceneRenderer.camera);
}
};
new spine.SpinePlayer(playerElement, config);
アバター
Mario

Mario
  • 記事: 3031

Nate

Super cool! 8)
アバター
Nate

Nate
  • 記事: 11849


Return to Runtimes