@esotericsoftware/spine-core 4.0.14 → 4.0.18

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,9 +1,6 @@
1
1
  var spine = (() => {
2
2
  var __defProp = Object.defineProperty;
3
3
  var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
4
- var __require = typeof require !== "undefined" ? require : (x) => {
5
- throw new Error('Dynamic require of "' + x + '" is not supported');
6
- };
7
4
  var __export = (target, all) => {
8
5
  __markAsModule(target);
9
6
  for (var name in all)
@@ -512,6 +509,8 @@ var spine = (() => {
512
509
  constructor(name) {
513
510
  super(name);
514
511
  this.id = _VertexAttachment.nextID++;
512
+ this.bones = null;
513
+ this.vertices = null;
515
514
  this.worldVerticesLength = 0;
516
515
  this.deformAttachment = this;
517
516
  }
@@ -594,6 +593,8 @@ var spine = (() => {
594
593
  // spine-core/src/Animation.ts
595
594
  var Animation = class {
596
595
  constructor(name, timelines, duration) {
596
+ this.timelines = null;
597
+ this.timelineIds = null;
597
598
  if (!name)
598
599
  throw new Error("name cannot be null.");
599
600
  this.name = name;
@@ -662,6 +663,8 @@ var spine = (() => {
662
663
  };
663
664
  var Timeline = class {
664
665
  constructor(frameCount, propertyIds) {
666
+ this.propertyIds = null;
667
+ this.frames = null;
665
668
  this.propertyIds = propertyIds;
666
669
  this.frames = Utils.newFloatArray(frameCount * this.getFrameEntries());
667
670
  }
@@ -695,6 +698,7 @@ var spine = (() => {
695
698
  var CurveTimeline = class extends Timeline {
696
699
  constructor(frameCount, bezierCount, propertyIds) {
697
700
  super(frameCount, propertyIds);
701
+ this.curves = null;
698
702
  this.curves = Utils.newFloatArray(frameCount + bezierCount * 18);
699
703
  this.curves[frameCount - 1] = 1;
700
704
  }
@@ -1754,6 +1758,8 @@ var spine = (() => {
1754
1758
  Property.deform + "|" + slotIndex + "|" + attachment.id
1755
1759
  ]);
1756
1760
  this.slotIndex = 0;
1761
+ this.attachment = null;
1762
+ this.vertices = null;
1757
1763
  this.slotIndex = slotIndex;
1758
1764
  this.attachment = attachment;
1759
1765
  this.vertices = new Array(frameCount);
@@ -1970,6 +1976,7 @@ var spine = (() => {
1970
1976
  var _EventTimeline = class extends Timeline {
1971
1977
  constructor(frameCount) {
1972
1978
  super(frameCount, _EventTimeline.propertyIds);
1979
+ this.events = null;
1973
1980
  this.events = new Array(frameCount);
1974
1981
  }
1975
1982
  getFrameCount() {
@@ -2012,6 +2019,7 @@ var spine = (() => {
2012
2019
  var _DrawOrderTimeline = class extends Timeline {
2013
2020
  constructor(frameCount) {
2014
2021
  super(frameCount, _DrawOrderTimeline.propertyIds);
2022
+ this.drawOrders = null;
2015
2023
  this.drawOrders = new Array(frameCount);
2016
2024
  }
2017
2025
  getFrameCount() {
@@ -2050,6 +2058,7 @@ var spine = (() => {
2050
2058
  super(frameCount, bezierCount, [
2051
2059
  Property.ikConstraint + "|" + ikConstraintIndex
2052
2060
  ]);
2061
+ this.ikConstraintIndex = 0;
2053
2062
  this.ikConstraintIndex = ikConstraintIndex;
2054
2063
  }
2055
2064
  getFrameEntries() {
@@ -2135,6 +2144,7 @@ var spine = (() => {
2135
2144
  super(frameCount, bezierCount, [
2136
2145
  Property.transformConstraint + "|" + transformConstraintIndex
2137
2146
  ]);
2147
+ this.transformConstraintIndex = 0;
2138
2148
  this.transformConstraintIndex = transformConstraintIndex;
2139
2149
  }
2140
2150
  getFrameEntries() {
@@ -2234,6 +2244,7 @@ var spine = (() => {
2234
2244
  var PathConstraintPositionTimeline = class extends CurveTimeline1 {
2235
2245
  constructor(frameCount, bezierCount, pathConstraintIndex) {
2236
2246
  super(frameCount, bezierCount, Property.pathConstraintPosition + "|" + pathConstraintIndex);
2247
+ this.pathConstraintIndex = 0;
2237
2248
  this.pathConstraintIndex = pathConstraintIndex;
2238
2249
  }
2239
2250
  apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) {
@@ -2364,6 +2375,7 @@ var spine = (() => {
2364
2375
  // spine-core/src/AnimationState.ts
2365
2376
  var AnimationState = class {
2366
2377
  constructor(data) {
2378
+ this.data = null;
2367
2379
  this.tracks = new Array();
2368
2380
  this.timeScale = 1;
2369
2381
  this.unkeyedState = 0;
@@ -2842,6 +2854,7 @@ var spine = (() => {
2842
2854
  }
2843
2855
  trackEntry(trackIndex, animation, loop, last) {
2844
2856
  let entry = this.trackEntryPool.obtain();
2857
+ entry.reset();
2845
2858
  entry.trackIndex = trackIndex;
2846
2859
  entry.animation = animation;
2847
2860
  entry.loop = loop;
@@ -2952,6 +2965,34 @@ var spine = (() => {
2952
2965
  };
2953
2966
  var TrackEntry = class {
2954
2967
  constructor() {
2968
+ this.animation = null;
2969
+ this.previous = null;
2970
+ this.next = null;
2971
+ this.mixingFrom = null;
2972
+ this.mixingTo = null;
2973
+ this.listener = null;
2974
+ this.trackIndex = 0;
2975
+ this.loop = false;
2976
+ this.holdPrevious = false;
2977
+ this.reverse = false;
2978
+ this.eventThreshold = 0;
2979
+ this.attachmentThreshold = 0;
2980
+ this.drawOrderThreshold = 0;
2981
+ this.animationStart = 0;
2982
+ this.animationEnd = 0;
2983
+ this.animationLast = 0;
2984
+ this.nextAnimationLast = 0;
2985
+ this.delay = 0;
2986
+ this.trackTime = 0;
2987
+ this.trackLast = 0;
2988
+ this.nextTrackLast = 0;
2989
+ this.trackEnd = 0;
2990
+ this.timeScale = 0;
2991
+ this.alpha = 0;
2992
+ this.mixTime = 0;
2993
+ this.mixDuration = 0;
2994
+ this.interruptAlpha = 0;
2995
+ this.totalAlpha = 0;
2955
2996
  this.mixBlend = MixBlend.replace;
2956
2997
  this.timelineMode = new Array();
2957
2998
  this.timelineHoldMix = new Array();
@@ -3002,6 +3043,7 @@ var spine = (() => {
3002
3043
  constructor(animState) {
3003
3044
  this.objects = [];
3004
3045
  this.drainDisabled = false;
3046
+ this.animState = null;
3005
3047
  this.animState = animState;
3006
3048
  }
3007
3049
  start(entry) {
@@ -3128,6 +3170,7 @@ var spine = (() => {
3128
3170
  // spine-core/src/AnimationStateData.ts
3129
3171
  var AnimationStateData = class {
3130
3172
  constructor(skeletonData) {
3173
+ this.skeletonData = null;
3131
3174
  this.animationToMixTime = {};
3132
3175
  this.defaultMix = 0;
3133
3176
  if (!skeletonData)
@@ -3176,6 +3219,7 @@ var spine = (() => {
3176
3219
  var ClippingAttachment = class extends VertexAttachment {
3177
3220
  constructor(name) {
3178
3221
  super(name);
3222
+ this.endSlot = null;
3179
3223
  this.color = new Color(0.2275, 0.2275, 0.8078, 1);
3180
3224
  }
3181
3225
  copy() {
@@ -3399,6 +3443,7 @@ var spine = (() => {
3399
3443
  };
3400
3444
  var TextureAtlasReader = class {
3401
3445
  constructor(text) {
3446
+ this.lines = null;
3402
3447
  this.index = 0;
3403
3448
  this.lines = text.split(/\r\n|\r|\n/);
3404
3449
  }
@@ -3432,10 +3477,15 @@ var spine = (() => {
3432
3477
  };
3433
3478
  var TextureAtlasPage = class {
3434
3479
  constructor() {
3480
+ this.name = null;
3435
3481
  this.minFilter = TextureFilter.Nearest;
3436
3482
  this.magFilter = TextureFilter.Nearest;
3437
3483
  this.uWrap = TextureWrap.ClampToEdge;
3438
3484
  this.vWrap = TextureWrap.ClampToEdge;
3485
+ this.texture = null;
3486
+ this.width = 0;
3487
+ this.height = 0;
3488
+ this.pma = false;
3439
3489
  }
3440
3490
  setTexture(texture) {
3441
3491
  this.texture = texture;
@@ -3444,13 +3494,38 @@ var spine = (() => {
3444
3494
  }
3445
3495
  };
3446
3496
  var TextureAtlasRegion = class extends TextureRegion {
3497
+ constructor() {
3498
+ super(...arguments);
3499
+ this.page = null;
3500
+ this.name = null;
3501
+ this.x = 0;
3502
+ this.y = 0;
3503
+ this.offsetX = 0;
3504
+ this.offsetY = 0;
3505
+ this.originalWidth = 0;
3506
+ this.originalHeight = 0;
3507
+ this.index = 0;
3508
+ this.degrees = 0;
3509
+ this.names = null;
3510
+ this.values = null;
3511
+ }
3447
3512
  };
3448
3513
 
3449
3514
  // spine-core/src/attachments/MeshAttachment.ts
3450
3515
  var MeshAttachment = class extends VertexAttachment {
3451
3516
  constructor(name) {
3452
3517
  super(name);
3518
+ this.region = null;
3519
+ this.path = null;
3520
+ this.regionUVs = null;
3521
+ this.uvs = null;
3522
+ this.triangles = null;
3453
3523
  this.color = new Color(1, 1, 1, 1);
3524
+ this.width = 0;
3525
+ this.height = 0;
3526
+ this.hullLength = 0;
3527
+ this.edges = null;
3528
+ this.parentMesh = null;
3454
3529
  this.tempColor = new Color(0, 0, 0, 0);
3455
3530
  }
3456
3531
  updateUVs() {
@@ -3565,6 +3640,7 @@ var spine = (() => {
3565
3640
  var PathAttachment = class extends VertexAttachment {
3566
3641
  constructor(name) {
3567
3642
  super(name);
3643
+ this.lengths = null;
3568
3644
  this.closed = false;
3569
3645
  this.constantSpeed = false;
3570
3646
  this.color = new Color(1, 1, 1, 1);
@@ -3585,6 +3661,9 @@ var spine = (() => {
3585
3661
  var PointAttachment = class extends VertexAttachment {
3586
3662
  constructor(name) {
3587
3663
  super(name);
3664
+ this.x = 0;
3665
+ this.y = 0;
3666
+ this.rotation = 0;
3588
3667
  this.color = new Color(0.38, 0.94, 0, 1);
3589
3668
  }
3590
3669
  computeWorldPosition(bone, point) {
@@ -3620,6 +3699,9 @@ var spine = (() => {
3620
3699
  this.width = 0;
3621
3700
  this.height = 0;
3622
3701
  this.color = new Color(1, 1, 1, 1);
3702
+ this.path = null;
3703
+ this.rendererObject = null;
3704
+ this.region = null;
3623
3705
  this.offset = Utils.newFloatArray(8);
3624
3706
  this.uvs = Utils.newFloatArray(8);
3625
3707
  this.tempColor = new Color(1, 1, 1, 1);
@@ -3757,6 +3839,7 @@ var spine = (() => {
3757
3839
  // spine-core/src/AtlasAttachmentLoader.ts
3758
3840
  var AtlasAttachmentLoader = class {
3759
3841
  constructor(atlas) {
3842
+ this.atlas = null;
3760
3843
  this.atlas = atlas;
3761
3844
  }
3762
3845
  newRegionAttachment(skin, name, path) {
@@ -3794,6 +3877,10 @@ var spine = (() => {
3794
3877
  // spine-core/src/BoneData.ts
3795
3878
  var BoneData = class {
3796
3879
  constructor(index, name, parent) {
3880
+ this.index = 0;
3881
+ this.name = null;
3882
+ this.parent = null;
3883
+ this.length = 0;
3797
3884
  this.x = 0;
3798
3885
  this.y = 0;
3799
3886
  this.rotation = 0;
@@ -3825,6 +3912,9 @@ var spine = (() => {
3825
3912
  // spine-core/src/Bone.ts
3826
3913
  var Bone = class {
3827
3914
  constructor(data, skeleton, parent) {
3915
+ this.data = null;
3916
+ this.skeleton = null;
3917
+ this.parent = null;
3828
3918
  this.children = new Array();
3829
3919
  this.x = 0;
3830
3920
  this.y = 0;
@@ -4077,6 +4167,7 @@ var spine = (() => {
4077
4167
  // spine-core/src/AssetManagerBase.ts
4078
4168
  var AssetManagerBase = class {
4079
4169
  constructor(textureLoader, pathPrefix = "", downloader = null) {
4170
+ this.pathPrefix = null;
4080
4171
  this.assets = {};
4081
4172
  this.errors = {};
4082
4173
  this.toLoad = 0;
@@ -4160,7 +4251,7 @@ var spine = (() => {
4160
4251
  image.src = path;
4161
4252
  }
4162
4253
  }
4163
- loadTextureAtlas(path, success = null, error = null) {
4254
+ loadTextureAtlas(path, success = null, error = null, fileAlias = null) {
4164
4255
  let index = path.lastIndexOf("/");
4165
4256
  let parent = index >= 0 ? path.substring(0, index + 1) : "";
4166
4257
  path = this.start(path);
@@ -4169,7 +4260,7 @@ var spine = (() => {
4169
4260
  let atlas = new TextureAtlas(atlasText);
4170
4261
  let toLoad = atlas.pages.length, abort = false;
4171
4262
  for (let page of atlas.pages) {
4172
- this.loadTexture(parent + page.name, (imagePath, texture) => {
4263
+ this.loadTexture(fileAlias == null ? parent + page.name : fileAlias[page.name], (imagePath, texture) => {
4173
4264
  if (!abort) {
4174
4265
  page.setTexture(texture);
4175
4266
  if (--toLoad == 0)
@@ -4316,7 +4407,7 @@ var spine = (() => {
4316
4407
  this.finish(url, request.status, request.response);
4317
4408
  };
4318
4409
  request.onload = () => {
4319
- if (request.status == 200)
4410
+ if (request.status == 200 || request.status == 0)
4320
4411
  this.finish(url, 200, new Uint8Array(request.response));
4321
4412
  else
4322
4413
  onerror();
@@ -4337,7 +4428,7 @@ var spine = (() => {
4337
4428
  finish(url, status, data) {
4338
4429
  let callbacks = this.callbacks[url];
4339
4430
  delete this.callbacks[url];
4340
- let args = status == 200 ? [data] : [status, data];
4431
+ let args = status == 200 || status == 0 ? [data] : [status, data];
4341
4432
  for (let i = args.length - 1, n = callbacks.length; i < n; i += 2)
4342
4433
  callbacks[i].apply(null, args);
4343
4434
  }
@@ -4346,6 +4437,13 @@ var spine = (() => {
4346
4437
  // spine-core/src/Event.ts
4347
4438
  var Event = class {
4348
4439
  constructor(time, data) {
4440
+ this.data = null;
4441
+ this.intValue = 0;
4442
+ this.floatValue = 0;
4443
+ this.stringValue = null;
4444
+ this.time = 0;
4445
+ this.volume = 0;
4446
+ this.balance = 0;
4349
4447
  if (!data)
4350
4448
  throw new Error("data cannot be null.");
4351
4449
  this.time = time;
@@ -4356,6 +4454,13 @@ var spine = (() => {
4356
4454
  // spine-core/src/EventData.ts
4357
4455
  var EventData = class {
4358
4456
  constructor(name) {
4457
+ this.name = null;
4458
+ this.intValue = 0;
4459
+ this.floatValue = 0;
4460
+ this.stringValue = null;
4461
+ this.audioPath = null;
4462
+ this.volume = 0;
4463
+ this.balance = 0;
4359
4464
  this.name = name;
4360
4465
  }
4361
4466
  };
@@ -4363,6 +4468,9 @@ var spine = (() => {
4363
4468
  // spine-core/src/IkConstraint.ts
4364
4469
  var IkConstraint = class {
4365
4470
  constructor(data, skeleton) {
4471
+ this.data = null;
4472
+ this.bones = null;
4473
+ this.target = null;
4366
4474
  this.bendDirection = 0;
4367
4475
  this.compress = false;
4368
4476
  this.stretch = false;
@@ -4601,6 +4709,7 @@ var spine = (() => {
4601
4709
  constructor(name) {
4602
4710
  super(name, 0, false);
4603
4711
  this.bones = new Array();
4712
+ this.target = null;
4604
4713
  this.bendDirection = 1;
4605
4714
  this.compress = false;
4606
4715
  this.stretch = false;
@@ -4615,6 +4724,13 @@ var spine = (() => {
4615
4724
  constructor(name) {
4616
4725
  super(name, 0, false);
4617
4726
  this.bones = new Array();
4727
+ this.target = null;
4728
+ this.positionMode = null;
4729
+ this.spacingMode = null;
4730
+ this.rotateMode = null;
4731
+ this.offsetRotation = 0;
4732
+ this.position = 0;
4733
+ this.spacing = 0;
4618
4734
  this.mixRotate = 0;
4619
4735
  this.mixX = 0;
4620
4736
  this.mixY = 0;
@@ -4642,6 +4758,9 @@ var spine = (() => {
4642
4758
  // spine-core/src/PathConstraint.ts
4643
4759
  var _PathConstraint = class {
4644
4760
  constructor(data, skeleton) {
4761
+ this.data = null;
4762
+ this.bones = null;
4763
+ this.target = null;
4645
4764
  this.position = 0;
4646
4765
  this.spacing = 0;
4647
4766
  this.mixRotate = 0;
@@ -5061,6 +5180,13 @@ var spine = (() => {
5061
5180
  // spine-core/src/Slot.ts
5062
5181
  var Slot = class {
5063
5182
  constructor(data, bone) {
5183
+ this.data = null;
5184
+ this.bone = null;
5185
+ this.color = null;
5186
+ this.darkColor = null;
5187
+ this.attachment = null;
5188
+ this.attachmentTime = 0;
5189
+ this.attachmentState = 0;
5064
5190
  this.deform = new Array();
5065
5191
  if (!data)
5066
5192
  throw new Error("data cannot be null.");
@@ -5109,6 +5235,9 @@ var spine = (() => {
5109
5235
  // spine-core/src/TransformConstraint.ts
5110
5236
  var TransformConstraint = class {
5111
5237
  constructor(data, skeleton) {
5238
+ this.data = null;
5239
+ this.bones = null;
5240
+ this.target = null;
5112
5241
  this.mixRotate = 0;
5113
5242
  this.mixX = 0;
5114
5243
  this.mixY = 0;
@@ -5316,7 +5445,16 @@ var spine = (() => {
5316
5445
  // spine-core/src/Skeleton.ts
5317
5446
  var Skeleton = class {
5318
5447
  constructor(data) {
5448
+ this.data = null;
5449
+ this.bones = null;
5450
+ this.slots = null;
5451
+ this.drawOrder = null;
5452
+ this.ikConstraints = null;
5453
+ this.transformConstraints = null;
5454
+ this.pathConstraints = null;
5319
5455
  this._updateCache = new Array();
5456
+ this.skin = null;
5457
+ this.color = null;
5320
5458
  this.time = 0;
5321
5459
  this.scaleX = 1;
5322
5460
  this.scaleY = 1;
@@ -5779,15 +5917,25 @@ var spine = (() => {
5779
5917
  // spine-core/src/SkeletonData.ts
5780
5918
  var SkeletonData = class {
5781
5919
  constructor() {
5920
+ this.name = null;
5782
5921
  this.bones = new Array();
5783
5922
  this.slots = new Array();
5784
5923
  this.skins = new Array();
5924
+ this.defaultSkin = null;
5785
5925
  this.events = new Array();
5786
5926
  this.animations = new Array();
5787
5927
  this.ikConstraints = new Array();
5788
5928
  this.transformConstraints = new Array();
5789
5929
  this.pathConstraints = new Array();
5930
+ this.x = 0;
5931
+ this.y = 0;
5932
+ this.width = 0;
5933
+ this.height = 0;
5934
+ this.version = null;
5935
+ this.hash = null;
5790
5936
  this.fps = 0;
5937
+ this.imagesPath = null;
5938
+ this.audioPath = null;
5791
5939
  }
5792
5940
  findBone(boneName) {
5793
5941
  if (!boneName)
@@ -5881,7 +6029,7 @@ var spine = (() => {
5881
6029
 
5882
6030
  // spine-core/src/Skin.ts
5883
6031
  var SkinEntry = class {
5884
- constructor(slotIndex, name, attachment) {
6032
+ constructor(slotIndex = 0, name = null, attachment = null) {
5885
6033
  this.slotIndex = slotIndex;
5886
6034
  this.name = name;
5887
6035
  this.attachment = attachment;
@@ -5889,6 +6037,7 @@ var spine = (() => {
5889
6037
  };
5890
6038
  var Skin = class {
5891
6039
  constructor(name) {
6040
+ this.name = null;
5892
6041
  this.attachments = new Array();
5893
6042
  this.bones = Array();
5894
6043
  this.constraints = new Array();
@@ -6039,7 +6188,13 @@ var spine = (() => {
6039
6188
  // spine-core/src/SlotData.ts
6040
6189
  var SlotData = class {
6041
6190
  constructor(index, name, boneData) {
6191
+ this.index = 0;
6192
+ this.name = null;
6193
+ this.boneData = null;
6042
6194
  this.color = new Color(1, 1, 1, 1);
6195
+ this.darkColor = null;
6196
+ this.attachmentName = null;
6197
+ this.blendMode = null;
6043
6198
  if (index < 0)
6044
6199
  throw new Error("index must be >= 0.");
6045
6200
  if (!name)
@@ -6064,6 +6219,7 @@ var spine = (() => {
6064
6219
  constructor(name) {
6065
6220
  super(name, 0, false);
6066
6221
  this.bones = new Array();
6222
+ this.target = null;
6067
6223
  this.mixRotate = 0;
6068
6224
  this.mixX = 0;
6069
6225
  this.mixY = 0;
@@ -6085,6 +6241,7 @@ var spine = (() => {
6085
6241
  var SkeletonBinary = class {
6086
6242
  constructor(attachmentLoader) {
6087
6243
  this.scale = 1;
6244
+ this.attachmentLoader = null;
6088
6245
  this.linkedMeshes = new Array();
6089
6246
  this.attachmentLoader = attachmentLoader;
6090
6247
  }
@@ -7760,6 +7917,7 @@ var spine = (() => {
7760
7917
  // spine-core/src/SkeletonJson.ts
7761
7918
  var SkeletonJson = class {
7762
7919
  constructor(attachmentLoader) {
7920
+ this.attachmentLoader = null;
7763
7921
  this.scale = 1;
7764
7922
  this.linkedMeshes = new Array();
7765
7923
  this.attachmentLoader = attachmentLoader;