30 Commits

Author SHA1 Message Date
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
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
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
Mario Zechner
a911384e67 Re-export examples and copy to runtimes 2024-05-16 16:08:40 +02:00
Mario Zechner
ff9a6cde8b [godot] Fix runtime.sh and export.sh scripts. Reexport all assets with latest editor version. 2024-04-09 11:03:10 +02:00
Mario Zechner
32952de12d [cpp] Fixed parsing, physics, re-exported all assets and copied to runtime examples. 2024-04-02 17:51:14 +02:00
Mario Zechner
dcb73ec24e Updated example exports 2024-03-19 10:04:06 +01:00
Nathan Sweet
ecbc6329a9 Updated example exports to 4.2.32-beta. 2024-03-07 22:41:09 -04:00
Mario Zechner
2eb1033b65 Update example exports to 4.2.09-beta 2023-12-01 17:04:11 +01:00
Mario Zechner
c56c9b5cef [threejs] Fix color in fragment shader of log depth buffer example. 2023-09-04 09:54:50 +02:00
Mario Zechner
8e84ad990d |threejs] Add logarithmic depth buffer example. 2023-09-04 09:54:05 +02:00
Mario Zechner
54cc75c203 hreejs] Closes #2278, coordinate transform example. 2023-05-02 13:27:16 +02:00
Mario Zechner
ea8f9385fb Merge branch '4.0' into 4.1-beta
# Conflicts:
#	spine-ts/package-lock.json
#	spine-ts/spine-threejs/package.json
2022-05-30 11:48:34 +02:00
Mario Zechner
b46f55b25b [threejs] Updated to r140 2022-05-30 11:47:16 +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
1a1b551e8b [runtimes] Re-exported examples with 4.1.23-beta, populated runtime examples. 2022-03-25 13:40:03 +01:00
Mario Zechner
0486bbda74 [ts][threejs] Added orbital controls to threejs example. 2022-03-22 00:27:27 +01:00
Mario Zechner
78e8f637bb Merge branch '4.0' into 4.1-beta
# Conflicts:
#	spine-ts/package-lock.json
#	spine-ts/package.json
#	spine-ts/spine-canvas/package.json
#	spine-ts/spine-core/package.json
#	spine-ts/spine-player/package.json
#	spine-ts/spine-threejs/package.json
#	spine-ts/spine-webgl/package.json
2022-03-21 19:32:37 +01:00
Mario Zechner
5365d661b6 [ts][threejs] Update to latest THREE, fix shader compilation error in THREE 138. 2022-03-21 19:26:29 +01:00
Mario Zechner
216423231d Merge branch '4.0' into 4.1-beta
# Conflicts:
#	spine-ts/package-lock.json
#	spine-ts/package.json
#	spine-ts/spine-canvas/package.json
#	spine-ts/spine-core/package.json
#	spine-ts/spine-player/package.json
#	spine-ts/spine-threejs/package.json
#	spine-ts/spine-webgl/package.json
2022-03-17 11:54:49 +01:00
Mario Zechner
dd7a651144 [ts][threejs] Allow passing material customizer to SkeletonMesh. 2022-03-17 11:48:32 +01:00
badlogic
ecbe087227 Merge branch '4.0' into 4.1-beta
# Conflicts:
#	spine-ts/package-lock.json
#	spine-ts/spine-threejs/package.json
2021-10-20 00:10:54 +02:00
badlogic
38cc19f16d [ts][threejs] Added multi-page atlas and blend modes support
Also updated to latest ThreeJS release and some clean-up.
2021-10-20 00:09:31 +02:00
badlogic
a0f1ed1b9b [runtimes] Fixed and updated example exports with 4.1.04-beta
- Fixed SkeletonBinary.ts
- Updated dragon example to use sequences
2021-10-13 17:52:34 +02:00
Mario Zechner
67c0d39eab [runtimes] Fixed owl example project, export and runtime scripts
The owl example project was not keying the control bone, leading to incorrect additive blending. The export.sh and runtimes.sh script in example/export did not account for the folder structure change in spine-ts.
2021-09-14 00:02:04 +02:00
Mario Zechner
3d3589f265 [ts] Refactor build, don't commit artifacts
npm install will automatically build everything necessary for local development and viewing the examples.
2021-09-01 11:09:31 +02:00
Mario Zechner
de6cee955b [ts] Remove old namespaces, dev build
Previously, we'd export to global objects called spine.canvas, spine.webgl, spine.threejs. Going forward, all Spine APIs will be hosted by the global spine object when the runtime is used straight from the bundled .js files in the build/ folder. This is a minor change with a simple fix on the user side, i.e. replace spine.canvas. with spine.
2021-08-27 18:48:17 +02:00
Mario Zechner
187b2d88f1 [ts] Minor touch up of threejs example. 2021-08-26 14:28:14 +02:00
Mario Zechner
bf347df8af [ts] Modularized spine-threejs, removed threejs typings 2021-08-26 14:20:27 +02:00
Mario Zechner
474dae82a0 ES2015 modulification of spine-ts core. 2021-08-20 16:24:10 +02:00