569 Commits

Author SHA1 Message Date
Nathan Sweet
5ac9ed372e [ts] Player, expose some fields. 2021-06-20 15:52:43 -04:00
Nathan Sweet
3d2891a224 [ts] Player, set bg color on player div, not parent. 2021-06-20 15:13:41 -04:00
Nathan Sweet
b044bdbf47 [ts] Player updates.
* If no config animation, start paused and set one when first clicked (showControls only).
* Updated player editor to 4.0.
* Don't name example index.html to make it easier to reach other files in same dir.
* Adjust CSS.
2021-06-20 14:46:48 -04:00
Nathan Sweet
4742c0d987 [ts] Fixed compilation error. 2021-06-20 13:52:30 -04:00
Nathan Sweet
cae8b6036e [ts] Player, if config.success set an animation but not a viewport, set a viewport. 2021-06-20 13:44:04 -04:00
Nathan Sweet
99f8cba35f [ts] Player updates.
* Updated config doc comments.
* Check undefined without typeof. Discussion: https://stackoverflow.com/a/22053469/187883
* Use transparent bg color by default if alpha is true.
* Set bg color on parent to avoid flash.
* render->create (so it doesn't seem like it's about drawing).
* Sorted members.
* Use addEventListener, else only the last player event handler is used.
* Set the initial animation when loaded, not whenever track 0 is empty.
* If an animation is not specified, play an empty animation.
* If an animation is set in success(), don't set any animation.
* Don't clearTracks in setAnimation, don't use AnimationState in calculateAnimationViewport -- those prevent mixing.
* setAnimation returns the TrackEntry.
* Added addAnimation and setViewport.
* Expose play() and pause().
* Keep control bones inside the canvas.
* LoadingScreen scales down.
* Set minimal CSS so no external CSS is needed when !showControls.
* Use screen instead of world coordinates for control bone hit detection, so it works at any size.
* Choose closest control bone instead of last.
2021-06-20 13:24:53 -04:00
Nathan Sweet
e03fa1d5d3 [ts] Default parameters for AnimationState. 2021-06-20 09:01:21 -04:00
Nathan Sweet
7800918ea4 [ts] Fixed player "null" text appearing in DOM. 2021-06-20 01:23:22 -04:00
Nathan Sweet
78a730a6d7 [ts] Improvements for player, webgl.
* Rendering, added support for separate color/alpha src blend funcs.
* LoadingScreen, set camera zoom to fade out and black flash, use PMA to fix ringing artifacts when scaled, fade in to help hide dropped frames as page loads, use separate color/alpha src blend funcs to properly blend quad when loading screen fades out, oxipng PNGs.
* Moved some private constants out of their class to avoid class name prefix.
* Player, clean up full pass OCD town, showError throws when possible so stacktrace isn't lost, added showLoading to config, don't create UI when !showControls, removed findWithId (id is unique for entire document), use built-in for findWithClass/contains, var->let, don't clear screen twice during loading, other minor stuff.
2021-06-20 01:20:31 -04:00
Nathan Sweet
2911f9da5e [ts] Demo asset update, demos clean up. 2021-06-20 01:07:29 -04:00
Nathan Sweet
1818446ead [ts] Player, sorted exported classes near the top of the file. 2021-06-20 00:11:30 -04:00
Nathan Sweet
ca9a3ff7c2 [ts] Set path for demos, update order. 2021-06-18 21:48:40 -04:00
Nathan Sweet
46416099c4 [ts] Update build file. 2021-06-18 20:16:25 -04:00
Nathan Sweet
173a61be7f [ts] Removed SharedAssetManager. Added webworker support to AssetManager. AssetManager clean up.
Related: #1762
2021-06-18 19:36:05 -04:00
Nathan Sweet
5d6f46d295 [ts] Update demos to 4.0 and new AssetManager. 2021-06-18 18:48:58 -04:00
Nathan Sweet
43cb6dfe22 [ts] AssetManager and Player updates to support sharing assets.
* Removed # parsing from SpinePlayer, replaced with config.jsonField.
* Refactored AssetMananger to split downloading from asset creation.
* Allow Downloader to be specified in SpinePlayer config so multiple players don't download the same assets.
* Added AssetManager#loadJson so the text is only parsed once.
* TextureAtlas is still parsed multiple times. :(
* AssetMananger clean up, catch more errors, log error, don't keep rendering after an error.
2021-06-18 02:31:10 -04:00
Nathan Sweet
cf35d1e982 [ts] Don't use the anchor part of a spine-player jsonUrl in the asset name. 2021-06-17 01:29:42 -04:00
Nathan Sweet
6d7f773bf1 [ts] Improved player error messages. 2021-06-17 01:11:32 -04:00
Nathan Sweet
87886adcfe [ts] If the spine-player jsonUrl has an anchor, use it to find the skeleton in the JSON.
This enables multiple skeletons in the same JSON file.
2021-06-17 01:07:42 -04:00
badlogic
731a5ac5af [ts] Reset mixBlend in track entry, see #1903 2021-06-15 13:35:30 +02:00
Mario Zechner
8bb38a7fb0 [ts] Ensure clipper.clipEnd() is called appropriately. See #1694 2021-06-14 15:20:08 +02:00
Nathan Sweet
3e16d21e3d [ts] README update for canvas. 2021-06-11 16:36:26 -04:00
badlogic
cf24f5d678 Merge branch '3.8' into 4.0-beta
# Conflicts:
#	spine-libgdx/spine-libgdx/pom.xml
#	spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/SkeletonViewer.java
#	spine-ts/build/spine-all.js.map
#	spine-ts/build/spine-canvas.js.map
#	spine-ts/build/spine-core.js.map
#	spine-ts/build/spine-player.js.map
#	spine-ts/build/spine-threejs.js.map
#	spine-ts/build/spine-webgl.js.map
2021-06-10 15:10:00 +02:00
badlogic
6314eaf908 [webgl] Fix worker mode, closes #1804 2021-06-10 15:05:13 +02:00
Nathan Sweet
0347c262e0 [ts, csharp] Revert RegionAttachment#UpdateOffset from csharp to ts, instead use ts code.
#1889
2021-06-10 00:04:28 -04:00
Nathan Sweet
aa752c49d4 [ts] Fixed canvas renderer not accounting for whitespace stripping.
closes #1889
2021-06-09 23:55:52 -04:00
badlogic
6ae45f1a5a [ts] Port IK constraint changes
See

33bce01fee
f9862b10b3
2021-06-09 15:07:44 +02:00
Mario Zechner
c76cdccf88 [ts] Undo fixup in TextureAtlas. The change prevented multi-page atlas parsing from working due to !""==null in JS. 2021-06-07 13:27:47 +02:00
Nathan Sweet
d856ece2f2 SkeletonJson clean up. 2021-06-06 23:18:12 -04:00
Nathan Sweet
6428b82e1e [lua] 4.0 port fixes. 2021-06-05 21:55:01 -04:00
Nathan Sweet
a5be08a62a More clean up. 2021-06-05 21:16:36 -04:00
Nathan Sweet
700d2897a8 Various clean up. 2021-06-04 22:16:54 -04:00
Nathan Sweet
3ecf7929bf [ts] Use constant values instead of static fields.
Even this ugliness is less ugly than TypeScript static field access. Smaller too.
2021-06-04 01:35:59 -04:00
Nathan Sweet
afcd899bca [ts] Removed error checking in loaders.
Safe to assume the data is valid. If not the ref impl can be used to check it, which has error checks.
2021-06-04 00:54:45 -04:00
Nathan Sweet
7df74c2fa4 Various fixes, clean up.
* Added missing CurveTimeline#shrink calls. c and cpp got BOZO comments until the method is added.
* SkeletonJson#readCurve clean up.
* ts, use shorthand for null checks.
* csharp, don't use unnecessary hasNext local.
2021-06-03 21:42:35 -04:00
Nathan Sweet
11ea258d8e [ts] Example loads both JSON and binary. 2021-06-03 18:03:32 -04:00
Nathan Sweet
7aa940a961 Fixes for reading mix X/Y. 2021-06-03 15:33:48 -04:00
Mario Zechner
315ad0e523 [ts] Update build artifacts. 2021-05-31 11:49:37 +02:00
Nathan Sweet
81744da44a [ts] Port of fix for applying a constraint reverting changes from other constraints.
#1896
2021-05-31 01:42:33 -04:00
Nathan Sweet
6dfae6df3c Missing port: Fixed AnimationState crash when the number of timelines changes during a mix.
Ref impl commit: b99df7286aa933411f90eda6dbdeffd936058ae4
2021-05-31 01:26:41 -04:00
Nathan Sweet
551f33b2d1 [ts] Clean up, build fixes. 2021-05-30 20:17:54 -04:00
Nathan Sweet
05327b8d11 [ts] Clean up. 2021-05-30 16:53:56 -04:00
Nathan Sweet
80734017e0 [as3] Use function to get JSON values, better matches spine-ts. 2021-05-30 13:02:28 -04:00
badlogic
9bcb5c16c4 Merge branch '3.8' of https://github.com/esotericsoftware/spine-runtimes into 3.8 2021-05-27 17:41:08 +02:00
badlogic
5c1d4c4369 [ts][player] Made Player.setAnimation() public and added a loop parameter. See player example on how to manually trigger animations. 2021-05-27 17:40:13 +02:00
badlogic
34ccbce8fd [ts] Fix build artifacts after merge. 2021-05-18 12:00:10 +02:00
Harald Csaszar
646b2934bc Merge branch '3.8' into 4.0-beta
Note: the following files were resoluved using ours (4.0-beta state):
- spine-ts/build/spine-all.js.map
- spine-ts/build/spine-player.js.map
2021-05-18 11:37:44 +02:00
badlogic
69647313ef [ts][player] Better error message serialization. 2021-05-17 13:33:25 +02:00
badlogic
bef00617d7 [ts] Fix applying attachment timeline in AnimationState
AnimatinState.setAttachment was directly setting the slot.attachment field instead of calling the setter. This caused the deform array from a previous attachment to linger around and be applied to the current attachment incorrectly.
2021-05-06 15:42:58 +02:00
Ivan Popelyshev
a28296f1dc
fix link (#1882) 2021-04-29 13:50:08 +02:00