From 58f0bc0d0c6c0cab2171c01600dcbd30f51b458d Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 14 Mar 2022 11:23:53 +0100 Subject: [PATCH] Added promise based AssetManager.loadAll(), Skeleton.getBoundsRect() helper method. --- CHANGELOG.md | 2 + spine-ts/index.html | 1 + spine-ts/spine-canvas/example/index.html | 203 +++++------------- .../spine-canvas/example/mouse-click.html | 111 ++++++++++ spine-ts/spine-core/src/AssetManagerBase.ts | 15 ++ spine-ts/spine-core/src/Skeleton.ts | 9 + 6 files changed, 192 insertions(+), 149 deletions(-) create mode 100644 spine-ts/spine-canvas/example/mouse-click.html diff --git a/CHANGELOG.md b/CHANGELOG.md index c4a7725ad..39acf1dbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -634,6 +634,8 @@ * Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh. * Added IK softness. * Added `AssetManager.setRawDataURI(path, data)`. Allows to embed data URIs for skeletons, atlases and atlas page images directly in the HTML/JS without needing to load it from a separate file. + * Added `AssetManager.loadAll()` to allow Promise/async/await based waiting for completion of asset load. See the `spine-canvas` examples. + * Added `Skeleton.getBoundRect()` helper method to calculate the bouding rectangle of the current pose, returning the result as `{ x, y, width, height }`. Note that this method will create temporary objects which can add to garbage collection pressure. ### WebGL backend * `Input` can now take a partially defined implementation of `InputListener`. diff --git a/spine-ts/index.html b/spine-ts/index.html index 1d8787794..205e9416e 100644 --- a/spine-ts/index.html +++ b/spine-ts/index.html @@ -14,6 +14,7 @@
  • Canvas
  • Player