68 Commits

Author SHA1 Message Date
Nathan Sweet
4e1fe97fb3 [ts] Player, added config.update and config.draw. 2021-06-20 18:51:22 -04:00
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
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
1818446ead [ts] Player, sorted exported classes near the top of the file. 2021-06-20 00:11:30 -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
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
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
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
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
01902e2393 Merge branch '3.8' into 4.0-beta 2021-04-06 19:05:52 +02:00
badlogic
748a03c7d7 [ts] Fix for NaN bounds
This is a temporary fix. Customer send reproduction sample. A slot has a mesh and corresponding deform. The number of vertices in the mesh is != the number of vertices in the deform, resulting in NaNs, which propagate to the bounds calculation of the web player. It is unclear how the mesh and deform can have a different number of vertices.
2021-04-06 14:13:04 +02:00
badlogic
688d855006 [runtimes] Updated examples with Editor version 4.0.58-beta. 2021-03-01 10:05:26 +01:00
badlogic
9087ed61ae [ts] Updated parser to new atlas format
Not quite working yet.
2020-12-28 12:11:25 +01:00
badlogic
490d169ea2 [ts] Closes #1804. 2020-11-27 18:45:18 +01:00
badlogic
88f0d98dd2 [ts] Finished 4.0 port. See #1796 2020-11-27 17:53:27 +01:00
Nathan Sweet
98a6c8f696 Exported examples with export.sh 4.0.05-beta and ran runtimes.sh. 2020-10-10 16:22:40 -07:00
badlogic
b67bf992a0 Single bone IK fix and license header update. Closes #1580, closes #1581. 2019-12-20 12:20:46 +01:00
badlogic
033703e900 [player] Implemented generator reset. 2019-12-14 02:29:32 +01:00
badlogic
121467572c [player] Added Player.stopRendering() to interrupt the requestAnimationFrame loop. 2019-12-14 02:19:22 +01:00
badlogic
a5428585e2 [player] Reworked generator. 2019-12-14 01:57:01 +01:00
badlogic
a2bae9dea4 [ts] Generator background image UI and application. 2019-11-28 10:35:16 +01:00
badlogic
c37916a731 [ts][player] Only accept background image bounds if fully specified. 2019-11-27 15:15:56 +01:00
badlogic
fca2f0c7af [ts] web player generator. 2019-11-26 18:12:13 +01:00
badlogic
16bd92f443 [ts][player] Added asset embedding examples for Spine Web Player. 2019-11-07 15:42:14 +01:00
badlogic
8e0a2e0c75 [ts][player] Added AssetManager.setRawDataURI(path, name). Allows to set a path and corresponding raw data URI which enables embedding of resources like skeletons, atlases, and so on directly in HTML/JS. Added SpinePlayerConfig.rawDataURIs, see the player example for a demonstration. Also closes #1541, closes #1539. 2019-11-05 15:20:50 +01:00
NathanSweet
842dffbd83 [all] Source clean up, formatting, and tabs for indentation. 2019-08-27 15:57:14 +02:00
badlogic
bb51ec7f23 Updated examples, removed stretch-ik stretchyman. 2019-08-05 17:31:15 +02:00
badlogic
ae6892cdfd [ts][player] Improved check if only one skin/animation should be allowed and display buttons accordingly. 2019-07-09 16:58:24 +02:00
badlogic
f8f495524e Updated example exports, fixed up example projects with mix-and-match skin api demo. 2019-07-09 13:47:05 +02:00
badlogic
6850a019ec Updated examples again, final binary format change. 2019-06-19 18:02:20 +02:00
badlogic
5f13f1b8e6 Exported all examples with 3.8.25-beta to include file format changes in .json and .skel files. 2019-06-19 16:56:47 +02:00
badlogic
5d974e4480 Added mix-and-match assets, modified export scripts, added libGDX sample. See #1375. 2019-06-13 15:58:16 +02:00
badlogic
ca3916dad8 [ts] Added support for loading binaries via SkeletonBinary. Player configuration object now lets you specify skelUrl instead of jsonUrl to load from a binary file. Updated demos to use .skel files instead of .json. 2019-06-07 17:21:53 +02:00
badlogic
1ec6e26b71 Updated example exports and copies in runtime example projects to the latest .json and .skel formats. 2019-06-05 11:20:43 +02:00
badlogic
3aa14d9b86 [ts] Ported skin bones/constraints changes. See #1346. 2019-06-04 15:53:34 +02:00
badlogic
09130b15df Merge branch '3.7' into 3.8-beta 2019-05-02 11:43:36 +02:00
badlogic
7f7e5f0fec Updated license headers and LICENSE files. 2019-05-02 11:38:19 +02:00
badlogic
c68d85a1fc [c][cpp] Ported addition of x/y bounding coordinates to SkeletonData. See #1325. 2019-04-16 14:06:41 +02:00
badlogic
4406cdfba0 Updated examples in example projects. 2019-02-19 15:59:30 +01:00