56 Commits

Author SHA1 Message Date
Davide Tantillo
b63a29e3b5 [ts][webcomponents] Moved dispose example in its own file. 2025-05-22 17:03:23 +02:00
Davide
c9b040f797
[ts] Add spine-webcomponents package
* [ts] poc wegl overlay

* [ts] poc wegl overlay

* canvas4

* overlay 4

* overlay

* overlay fix scroll cut

* Zoom fix - WIP horizontal scroll bug see comment at line 495

* Scroll should be resolved

* web component

* Loading

* mostly work - when overflow top/bottom...are > 0, widgets slightly jump on up and down fast scroll.

* Renamed

* Add OffScreenUpdateBehaviour

* Fixed loading spinner example

* Translate is done each frame through requestAnimationFrame.

* Added clip.

* Removed SpineCanvasApp dependency.

* Removed code duplication for clipping into div

* Refactor drag logic. Drag works with clip too.

* WIP - Doc before refactor

* WIP - Refactor + animation and skin attribute change will reinit the widget

* Modified export script to copy chibi

* Fix zoom bug due to screen size remaining the same at different zoom level.

* Removed useless changes on other classes.

* Removed custom LoadingSpinnerWindget class. Added a new specific method in LoadingSpinner.

* Fix 1 pixel misalignment in non clip mode.

* Cleaned webcomponent example.

* Made span fps display configurable.

* Made some changes to make it work on old browsers.

* Manage lifecycle for Input and SpineWebComponentOverlay. Missing SpineWebComponentWidget.

* Managed lifecycle for SpineWebComponentWidget.

* Fixed input remove listener. Run tsfmt.

* Fixed infinite requestAnimationFrame calls.

* Fix x-axis and y-axis not working in clip mode.

* Fix widget using overlay before overlay webcomponent is fully upgraded.

* Restore resize observer since the window resize event does not fire on body resize, but on window resize. It's supported by 93% of the browsers.

* Add padding attributes/properties.

* Exposed parameters to set bounds.
Deeply changed how bounds work, especially for the fact that they are not auto recalculated anymore if the animation is changed (unless autoRecalculateBounds is set to true).

* Changes to make the widget more dynamic while changing attributes. See now webcomponent-gui.html.

* Initial support of spine-widget into scrollable containers, and overlay-id for multiple spine-overlay.
working

* WIP - Added/Changed:
- overlay loading: now overlay is moved as the last element from where it is inserted to avoid widgets covered by backgrounds of html elements after it.
- default overlayId
- widget position in overlay coordinates (worldX, worldY) (experimental)
- cursor position on widget world (cursorWorldX, cursorWorldY) (experimental)
- jsonSkeletonKey: allow to load a specific skeleton in json containing multiple skeletons
- onViewportManualStart: start the widget when in manual-start and enters the viewport the first time
- overlayAssignedPromise: a promise that resolves when the overlay is assigned to the widget. Reads the comment on it
- appendTo: to append the widget created using js and wait for the overlayAssignedPromise to resolve
- changed how loadingPromise works
- added cursorCanvasX, cursorCanvasY, cursorWorldX, cursorWorldY to overlay (experimental)

* Docs and minor fixes.

* Fixed example.

* Allow multiple widgets for the same HTMLElement

* Simplified clip to div by using scissor rather than changing viewport+camera.
In this way we can treat coordinates equally for cliped and not clipped widgets!

* Simplified drag calculation and drag debug removing an additional div.

* WIP - Add interactivity events. isdraggable is currently broken.

* Add interactivity events.

* Fixed a bug where an infinite loop occurred in Firefox when compareDocumentPosition results in DOCUMENT_POSITION_DISCONNECTED.

In both Chrome and Firefox, when an element is inside a webcomponent the comparison results in DOCUMENT_POSITION_DISCONNECTED. But in Firefox the element result in DOCUMENT_POSITION_FOLLOWING too, leading to an infinite loop.

* Fix physicsTranslate y opposite direction while dragging.

* Add followSlot method

* Add animations, animations-bound and default-mix attributes.

* Original event is passed to bounds and slot callbacks.

* Made overlay canvas size consistent across different browsers. Base size is not anymore the screen size due to browser limitations, but the window size. This will trigger additional canvas resize on window resize.

* Reduce DPI if canvas is too big to avoid page crash - this happen on webpage on mobile with high dpi and missing meta viewport tag with width=device-width.

* Pma properties on atlas is used to detect pma textures.

* Add rawData attribute to pass s stringified JSON object for inline base64 assets.

* format

* Prevent useless resize.

* Prevent error on disconnected callback

* Update tutorial.

* Fixed multiple click events on mobile touches. Add team example.

* Fixed slot interaction issue.

* Resize overlay when follow slot element is added.

* Add interactive widget example.

* Temporarily add windmill only manually to webgl assets

* Move getBounding in scrollable case.

* formatter

* Fixed overlay disconnectedCallback.

* Overlay should load not for DOMContentLoaded event only if document has already complete loading.

* Overlay parent bounding box determined only if necessary.

* Overlay needs to consider border if it's scrollable.

* Fixed issues with slot events on mobile.

* food app and cleanup

* Make overlayAssignedPromise private.

* Change scrollable to appendedToBody, make it private and determine it at dom connect.

* scrollable-tweak-off changed to no-auto-parent-transform.

* Update bounds and slot interaction method names.

* getHTMLElementReference to getHostElement.

* recalculateBounds and autoRecalculateBounds to calculateBounds and autoCalculateBounds.

* dpi to dpr and transform DPR to DevicePixelRatio when needed. Add @internal tag to internal fields.

* Properties rename.

* Better comments and variable names for canvas resize related stuff.

* callbacks renamed consistently.

* for each to for of.

* Update other names.

* onScreenManualStart to startWhenVisible. startWhenVisible set manualStart to true.

* fix return to continue in for of.

* Refcounter for asset manager and gl resources disposal for webcomponent.

* Fixes to asset manager ref counter.

* Add dispose example.

* Fix overlay init not completed in some scenario.
DOMContentLoaded is invoked only when document.readyState is interactive.

* Cleaned up examples.

* spinner to no-spinner.

* Move webcomponent to spine-widget folder.

* start won't reset bounds.

* Remove test file.

* Moved team example in its own page.

* Improved tutorial explanations.

* Moved some examples in their own pages.

* Formatter.

* Widgets dragged can be dragged even if host is offscreen.

* General refactor. spine-widget to spine-skeleton.

* spine-widget package renamed to spine-webcomponents.

* Moved assets to a single assets folder.

* Run formatter.

* Add beta notice.

* Changed widget occurrences to webcomponents.
2025-05-09 15:59:00 +02:00
Davide Tantillo
1530550acd [ts][pixi-v7][pixi-v8] Fixed slot objects ignoring negative parent bone scale. See #2818. 2025-04-24 16:03:25 +02:00
Davide Tantillo
62b5fc9e86 [ts][phaser-v3][phaser-v4] Aligned bounds and skeleton when gameobject origin is moved. Add AABBRectangleBoundsProvider. 2025-04-23 12:26:32 +02:00
Davide Tantillo
27f8150e56 [ts] Fixed typo in examples index.html. 2025-04-16 17:24:38 +02:00
Davide
b2c12b9d06
[ts][phaser-v3][phaser-v4] New runtime for phaser-v4. Moved phaser to phaser-v3 (#2815) 2025-04-16 17:01:53 +02:00
Davide Tantillo
e9ffad91c5 [ts][phaser] Add inline loading example to the examples list. 2025-03-14 16:44:29 +01:00
Davide Tantillo
f8bcbb3e59 [ts][pixi-v7] Allow to define a bounds providers for the Spine game object. See #2734. 2025-01-29 17:53:33 +01:00
Davide Tantillo
7594c959dc [ts][threejs] Add support for lighting and shadow. Upgraded three to 0.162.0. Added new constructor. 2024-12-06 11:22:53 +01:00
Davide Tantillo
3512e3ddff [ts][pixi] Add bunnymark example to compare performance among releases. 2024-11-14 10:56:11 +01:00
Davide Tantillo
6cc8809406 [ts][pixi] Move pixi to pixi-v7 2024-11-07 14:49:36 +01:00
Mat Groves
ecbe9b0247
Add PixiJS v8 support to spine (#2641)
* add v8 support to spine!

* Renamed examples folder for consistency.

* Gitignore dist.

* Tsconfig.

* Package json.

* Modification due to strictNullChecks=true.

* Run tsfmt.

* Use clipper.clipTriangles not deprecated version.

* Aligned example to spine-pixi (v7).

* Fix clipping dark tint wrong param.

* Removed useless clipper.

* Push texture issue repro example

* fix attachment.uvs by copying them

* SlotObject alpha connected to skeleton and slot alpha.

* add topology for future v8 release

* Dark tint rendered is enabled if at least one slot has dark tint, or by configuration.
Fixed clipping while using dark tint.

* Optimized clipping by using clipTrianglesUnpacked.

* Repro example for clipping issue.

* Aligned constructor and from signature of spine-pixi(-v7) to v8. Deprecated old signatures.

* Removed useless function.

* Fixed clipping issue flagging attachment as dirty if indices change.

* Clipping attachments clip slot object through Pixi Graphics masks.

* Add autoUpdate in SpineFromOptions

* Added javadoc to pixiv8

* Updated pixi7 examples to use SpineFromOptions interface

* Aligned atlas loader to use texturePreference for bundles.

* Add pool to manage slot objects masks

* Fixed minor issues with SpineDebugRenderer

* Aligned spine-pixi-v8 with latest spine-core

* Updated build and publish script

---------

Co-authored-by: Davide Tantillo <iamdjj@gmail.com>
2024-11-06 17:23:01 +01:00
Davide Tantillo
9e8b59df36 [ts][pixi] Removed bundle example in favor of updating documentation. 2024-09-09 15:16:48 +02:00
Richard Fu
167470fb16 [ts][pixi] Fix atlas src cannot be resolved for preferred texture 2024-09-09 15:16:48 +02:00
Mario Zechner
81312c8983 [canvaskit] HDPI support, fix blending, physics example 2024-07-09 11:41:48 +02:00
Mario Zechner
8c69162e2f [canvaskit] Add micro benchmark, delete Skia vertices after drawVertices 2024-07-08 17:40:51 +02:00
Mario Zechner
8c6e82581d [canvaskit] Add IK following example. 2024-07-08 17:15:05 +02:00
Mario Zechner
32f43fbf5d [canvaskit] More examples. 2024-07-08 16:35:42 +02:00
Mario Zechner
a1f077d43c [ts][canvaskit] Added CanvasKit runtime for NodeJS and browser environments 2024-07-05 15:18:06 +02:00
Davide Tantillo
f3b3cb429a [ts][threejs] Allow to load pma textures. Non-pma textures are pma on upload. Fixed blending modes. Add physics example.
Close #2503.
2024-07-02 18:09:40 +02:00
Davide Tantillo
e290569748 [ts][pixi] Add feature to attach pixi objects to slots
[ts][pixi] Format fix

[ts][pixi] Format fix

[ts][pixi] Use world scale for slot object.
2024-06-05 16:18:09 +02:00
Davide Tantillo
569adb1cd1 [ts][pixi] Add control bones example in example list 2024-05-28 11:41:41 +02:00
Davide Tantillo
83c987e43d [ts][phaser] Add physics support and examples. 2024-04-16 17:41:19 +02:00
Davide Tantillo
0ac67cfbee
[ts][pixi] Added PMA support. 2024-03-26 10:40:26 +01:00
Mario Zechner
8c515501ee [ts][webgl] Additional physics samples 2024-03-19 11:53:14 +01:00
badlogic
24f47cf8ce Merge branch '4.1' into 4.2-beta 2024-01-03 05:50:36 +01:00
Luke Ingram
238e86c58a [ts] Add examples for spine-pixi. 2023-12-22 13:06:25 -04:00
Mario Zechner
4e1907812e [ts] Remove physics examples not available in 4.1 2023-12-08 01:03:25 +01:00
Mario Zechner
3cce0af971 [ts] Clean-up examples
# Conflicts:
#	spine-ts/index.css
#	spine-ts/index.html
#	spine-ts/spine-player/example/physics.html
2023-12-08 01:02:28 +01:00
Mario Zechner
77fe988169 [ts] Clean-up examples 2023-12-06 04:02:56 +01:00
Mario Zechner
1c4aa3ccb0 [ts][player] Update physics example. 2023-12-06 03:18:31 +01:00
Mario Zechner
02773518b1 [ts] Fix physics! 2023-12-05 15:10:38 +01:00
Mario Zechner
2eb1033b65 Update example exports to 4.2.09-beta 2023-12-01 17:04:11 +01:00
Mario Zechner
4f33a2aae6 [phaser] Closes #2348, fix visibility test 2023-09-07 13:37:40 +02:00
Mario Zechner
2f33d326a8 [phaser] Closes #2356, only instantiate a single SceneRenderer for the whole game. 2023-09-05 15:22:33 +02:00
Mario Zechner
4af059f326 [phaser] Minor clean-up. 2023-09-04 10:49:38 +02:00
Mario Zechner
6ec9637ed6 [phaser] Closes #2333, users can set the name of the game object factory function via window.SPINE_GAME_OBJECT_TYPE, see custom-spine-object-type.html. 2023-09-04 10:35:24 +02:00
Mario Zechner
8e84ad990d |threejs] Add logarithmic depth buffer example. 2023-09-04 09:54:05 +02:00
Mario Zechner
8d04c7a75b [pixi] Clean-up and extend examples 2023-07-18 14:51:57 +02:00
Mario Zechner
ea2d0727c3 [pixi] Fix index.html 2023-06-27 15:27:41 +02:00
Mario Zechner
54cc75c203 hreejs] Closes #2278, coordinate transform example. 2023-05-02 13:27:16 +02:00
Mario Zechner
90e369fcfe [phaser] More example work, Stretchyman idle animation. 2023-04-27 17:25:23 +02:00
Mario Zechner
0815c4433b [phaser] Mix-and-match example, rework example index. 2023-04-18 11:18:55 +02:00
Mario Zechner
98f060b435 [ts] Refactor how textures are stored in texture regions, fix renderers, add custom attachment WebGL example. 2023-04-17 16:12:26 +02:00
Mario Zechner
22603c3f07 [ts] Fixed IK constraint NaN when a parent bone has zero scale. 2023-04-05 15:05:33 +02:00
Mario Zechner
a3dc1fdb33 [ts] Phaser plugin scaffold.
# Conflicts:
#	.gitignore
2022-12-27 11:32:33 +01:00
Mario Zechner
e01ba364df [ts][webgl] Added example demonstrating how to drag bones. Closes #2151. 2022-09-12 14:02:09 +02:00
Mario Zechner
82b607d738 [ts] Remove player editor, fix embedding examples, clean-up threejs example. 2022-03-25 14:03:20 +01:00
Mario Zechner
58f0bc0d0c Added promise based AssetManager.loadAll(), Skeleton.getBoundsRect() helper method. 2022-03-14 11:23:53 +01:00
Mario Zechner
02b894d8da [ts][player] Added SpinePlayer.dispose(), closes #2020 2022-01-24 22:04:29 +01:00