@eva/plugin-renderer-spine 2.0.0-beta.1 → 2.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,8 @@
1
+ import PixiSpine from 'pixi-spine';
1
2
  import { Spine as Spine_2 } from '@eva/spine-base';
2
3
  import { SpineParams } from '@eva/spine-base';
3
4
  import { SpineSystem as SpineSystem_2 } from '@eva/spine-base';
5
+ export { PixiSpine }
4
6
 
5
7
  export declare class Spine extends Spine_2 {
6
8
  }
@@ -1,34 +1,5 @@
1
- import { SpineSystem as SpineSystem$2, Spine as Spine$3 } from '@eva/spine-base';
2
1
  import { ExtensionType, checkExtension, Resolver, LoaderParserPriority, DOMAdapter, path, TextureSource, extensions, collectAllRenderables, Graphics, ViewContainer, Ticker, fastCopy, Texture as Texture$1, DEG_TO_RAD, Container, Cache, Assets, Text, Batcher, Color as Color$1, Geometry, Buffer, BufferUsage, Shader, compileHighShaderGlProgram, colorBitGl, generateTextureBatchBitGl, roundPixelsBitGl, compileHighShaderGpuProgram, colorBit, generateTextureBatchBit, roundPixelsBit, getBatchSamplersUniformGroup } from 'pixi.js';
3
-
4
- /*! *****************************************************************************
5
- Copyright (c) Microsoft Corporation. All rights reserved.
6
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
7
- this file except in compliance with the License. You may obtain a copy of the
8
- License at http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
12
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
13
- MERCHANTABLITY OR NON-INFRINGEMENT.
14
-
15
- See the Apache Version 2.0 License for specific language governing permissions
16
- and limitations under the License.
17
- ***************************************************************************** */
18
- /* global Reflect, Promise */
19
-
20
- var extendStatics = function(d, b) {
21
- extendStatics = Object.setPrototypeOf ||
22
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
23
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
24
- return extendStatics(d, b);
25
- };
26
-
27
- function __extends(d, b) {
28
- extendStatics(d, b);
29
- function __() { this.constructor = d; }
30
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
31
- }
2
+ import { SpineSystem as SpineSystem$1, Spine as Spine$2 } from '@eva/spine-base';
32
3
 
33
4
  var __defProp = Object.defineProperty;
34
5
  var __defNormalProp = (obj, key, value) =>
@@ -3720,14 +3691,17 @@ var _AnimationState = class {
3720
3691
  let finished = this.updateMixingFrom(from, delta);
3721
3692
  from.animationLast = from.nextAnimationLast;
3722
3693
  from.trackLast = from.nextTrackLast;
3723
- if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
3724
- if (from.totalAlpha == 0 || to.mixDuration == 0) {
3725
- to.mixingFrom = from.mixingFrom;
3726
- if (from.mixingFrom) from.mixingFrom.mixingTo = to;
3727
- to.interruptAlpha = from.interruptAlpha;
3728
- this.queue.end(from);
3694
+ if (to.nextTrackLast != -1) {
3695
+ const discard = to.mixTime == 0 && from.mixTime == 0;
3696
+ if (to.mixTime >= to.mixDuration || discard) {
3697
+ if (from.totalAlpha == 0 || to.mixDuration == 0 || discard) {
3698
+ to.mixingFrom = from.mixingFrom;
3699
+ if (from.mixingFrom != null) from.mixingFrom.mixingTo = to;
3700
+ to.interruptAlpha = from.interruptAlpha;
3701
+ this.queue.end(from);
3702
+ }
3703
+ return finished;
3729
3704
  }
3730
- return finished;
3731
3705
  }
3732
3706
  from.trackTime += delta * from.timeScale;
3733
3707
  to.mixTime += delta;
@@ -12423,7 +12397,7 @@ var vectorAux = new Vector2();
12423
12397
  Skeleton.yDown = true;
12424
12398
  var clipper = new SkeletonClipping();
12425
12399
  var maskPool = new Pool(() => new Graphics());
12426
- var Spine$2 = class extends ViewContainer {
12400
+ var Spine$1 = class extends ViewContainer {
12427
12401
  // Pixi properties
12428
12402
  batched = true;
12429
12403
  buildId = 0;
@@ -12967,7 +12941,7 @@ var Spine$2 = class extends ViewContainer {
12967
12941
  static from({ skeleton, atlas, scale = 1, darkTint, autoUpdate = true }) {
12968
12942
  const cacheKey = `${skeleton}-${atlas}-${scale}`;
12969
12943
  if (Cache.has(cacheKey)) {
12970
- return new Spine$2(Cache.get(cacheKey));
12944
+ return new Spine$1(Cache.get(cacheKey));
12971
12945
  }
12972
12946
  const skeletonAsset = Assets.get(skeleton);
12973
12947
  const atlasAsset = Assets.get(atlas);
@@ -12977,7 +12951,7 @@ var Spine$2 = class extends ViewContainer {
12977
12951
  parser.scale = scale;
12978
12952
  const skeletonData = parser.readSkeletonData(skeletonAsset);
12979
12953
  Cache.set(cacheKey, skeletonData);
12980
- return new Spine$2({
12954
+ return new Spine$1({
12981
12955
  skeletonData,
12982
12956
  darkTint,
12983
12957
  autoUpdate,
@@ -13472,6 +13446,7 @@ var pixiSpine = {
13472
13446
  ShearXTimeline,
13473
13447
  ShearYTimeline,
13474
13448
  Skeleton,
13449
+ SpineTexture,
13475
13450
  SkeletonBinary,
13476
13451
  SkeletonBounds,
13477
13452
  SkeletonClipping,
@@ -13482,7 +13457,7 @@ var pixiSpine = {
13482
13457
  Slot,
13483
13458
  SlotData,
13484
13459
  SpacingMode,
13485
- Spine: Spine$2,
13460
+ Spine: Spine$1,
13486
13461
  SpineDebugRenderer,
13487
13462
  SpinePipe,
13488
13463
  SpineTexture,
@@ -13510,25 +13485,13 @@ var pixiSpine = {
13510
13485
  WindowedMean,
13511
13486
  };
13512
13487
 
13513
- var SpineSystem = (function (_super) {
13514
- __extends(SpineSystem, _super);
13515
- function SpineSystem() {
13516
- return _super !== null && _super.apply(this, arguments) || this;
13488
+ class SpineSystem extends SpineSystem$1 {
13489
+ init() {
13490
+ super.init({ pixiSpine });
13517
13491
  }
13518
- SpineSystem.prototype.init = function () {
13519
- _super.prototype.init.call(this, { pixiSpine: pixiSpine });
13520
- };
13521
- return SpineSystem;
13522
- }(SpineSystem$2));
13523
- var SpineSystem$1 = SpineSystem;
13492
+ }
13524
13493
 
13525
- var Spine = (function (_super) {
13526
- __extends(Spine, _super);
13527
- function Spine() {
13528
- return _super !== null && _super.apply(this, arguments) || this;
13529
- }
13530
- return Spine;
13531
- }(Spine$3));
13532
- var Spine$1 = Spine;
13494
+ class Spine extends Spine$2 {
13495
+ }
13533
13496
 
13534
- export { Spine$1 as Spine, SpineSystem$1 as SpineSystem };
13497
+ export { pixiSpine as PixiSpine, Spine, SpineSystem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-spine",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.11",
4
4
  "description": "@eva/plugin-renderer-spine",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-spine.esm.js",
@@ -19,9 +19,9 @@
19
19
  "homepage": "https://eva.js.org",
20
20
  "dependencies": {
21
21
  "@eva/inspector-decorator": "^0.0.5",
22
- "@eva/plugin-renderer": "2.0.0-beta.1",
23
- "@eva/eva.js": "2.0.0-beta.1",
24
- "@eva/spine-base": "2.0.0-beta.1",
25
- "pixi.js": "^8.6.3"
22
+ "@eva/plugin-renderer": "2.0.0-beta.11",
23
+ "@eva/eva.js": "2.0.0-beta.11",
24
+ "@eva/spine-base": "2.0.0-beta.11",
25
+ "pixi.js": "^8.6.5"
26
26
  }
27
27
  }