From b63a29e3b5663ce1366cbd8be9e661a32e65505f Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Thu, 22 May 2025 16:55:46 +0200 Subject: [PATCH] [ts][webcomponents] Moved dispose example in its own file. --- spine-ts/index.html | 1 + .../spine-webcomponents/example/dispose.html | 170 +++++++++++++ .../spine-webcomponents/example/tutorial.html | 229 ------------------ 3 files changed, 171 insertions(+), 229 deletions(-) create mode 100644 spine-ts/spine-webcomponents/example/dispose.html diff --git a/spine-ts/index.html b/spine-ts/index.html index 430632b05..c625f53e8 100644 --- a/spine-ts/index.html +++ b/spine-ts/index.html @@ -200,6 +200,7 @@
  • App
  • Login
  • Game
  • +
  • Dispose
  • GUI
  • diff --git a/spine-ts/spine-webcomponents/example/dispose.html b/spine-ts/spine-webcomponents/example/dispose.html new file mode 100644 index 000000000..0266d5a6e --- /dev/null +++ b/spine-ts/spine-webcomponents/example/dispose.html @@ -0,0 +1,170 @@ + + + + + + Webcomponent GUI + + + + +
    +

    Dispose example

    + + If you remove a widget from the DOM, it won't be disposed because you might want to append it to another node. + If you want to actually dispose of a widget, call dispose() on it. + dispose() is safe and won't release resources if they're still used by other widgets. + +
    + If you want to dispose of everything, call dispose() on the overlay. + +

    + The following example allows you to create and dispose of widgets using the same assets. + Below, you can see the number of references to each asset. + A red message will appear when an asset is actually disposed. + The number of skeleton references is at minimum 1 because there's a skeleton on the bottom of the page the use the same skeleton file. +

    + + + +

    + + +

    + +
    + + + + + + +
    + + + + + \ No newline at end of file diff --git a/spine-ts/spine-webcomponents/example/tutorial.html b/spine-ts/spine-webcomponents/example/tutorial.html index 0b30525fa..f52bee662 100644 --- a/spine-ts/spine-webcomponents/example/tutorial.html +++ b/spine-ts/spine-webcomponents/example/tutorial.html @@ -1046,235 +1046,6 @@ async function updateCelesteAnimations() { ///////////////////// --> -
    - -
    - If you remove a widget from the DOM, it won't be disposed because you might want to append it to another node. - If you want to actually dispose of a widget, call dispose() on it. - dispose() is safe and won't release resources if they're still used by other widgets. - -
    - If you want to dispose of everything, call dispose() on the overlay. - -

    - The following example allows you to create and dispose of widgets using the same assets. - Below, you can see the number of references to each asset. - A red message will appear when an asset is actually disposed. - If the number of skeleton references is higher than expected, it's because other widgets on the page are still using it. -

    -

    - - -

    - Widgets: ? -
    - Skeleton references: ? -
    - Atlas references: ? DISPOSED -
    - Texture references: ? DISPOSED -
    - -
    -
    -
    - - - -
    -
    
    -                
    -            
    -
    - -
    - - - - -