simple-pixi-spine 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +200 -0
- package/dist/simple-pixi-spine.js +37 -0
- package/dist/simple-pixi-spine.js.map +7 -0
- package/dist/simple-pixi-spine.mjs +37 -0
- package/dist/simple-pixi-spine.mjs.map +7 -0
- package/dist/types/build.d.mts +1 -0
- package/dist/types/bundles/pixi-spine/rollup.config.d.mts +2 -0
- package/dist/types/bundles/pixi-spine/src/index.d.ts +5 -0
- package/dist/types/packages/base/src/SpineBase.d.ts +167 -0
- package/dist/types/packages/base/src/SpineDebugRenderer.d.ts +60 -0
- package/dist/types/packages/base/src/core/AttachmentType.d.ts +12 -0
- package/dist/types/packages/base/src/core/BinaryInput.d.ts +18 -0
- package/dist/types/packages/base/src/core/IAnimation.d.ts +131 -0
- package/dist/types/packages/base/src/core/IConstraint.d.ts +93 -0
- package/dist/types/packages/base/src/core/ISkeleton.d.ts +237 -0
- package/dist/types/packages/base/src/core/SkeletonBoundsBase.d.ts +51 -0
- package/dist/types/packages/base/src/core/TextureAtlas.d.ts +41 -0
- package/dist/types/packages/base/src/core/TextureRegion.d.ts +55 -0
- package/dist/types/packages/base/src/core/Utils.d.ts +198 -0
- package/dist/types/packages/base/src/core/versions.d.ts +15 -0
- package/dist/types/packages/base/src/index.d.ts +14 -0
- package/dist/types/packages/base/src/settings.d.ts +19 -0
- package/dist/types/packages/loader-3.8/src/index.d.ts +2 -0
- package/dist/types/packages/loader-4.0/src/index.d.ts +2 -0
- package/dist/types/packages/loader-4.1/src/index.d.ts +2 -0
- package/dist/types/packages/loader-4.2/src/index.d.ts +2 -0
- package/dist/types/packages/loader-base/src/SpineLoaderAbstract.d.ts +36 -0
- package/dist/types/packages/loader-base/src/atlasLoader.d.ts +5 -0
- package/dist/types/packages/loader-base/src/index.d.ts +4 -0
- package/dist/types/packages/loader-uni/src/Spine.d.ts +15 -0
- package/dist/types/packages/loader-uni/src/SpineLoader.d.ts +10 -0
- package/dist/types/packages/loader-uni/src/index.d.ts +3 -0
- package/dist/types/packages/runtime-3.7/src/Spine.d.ts +11 -0
- package/dist/types/packages/runtime-3.7/src/core/Animation.d.ts +307 -0
- package/dist/types/packages/runtime-3.7/src/core/AnimationState.d.ts +175 -0
- package/dist/types/packages/runtime-3.7/src/core/AnimationStateData.d.ts +17 -0
- package/dist/types/packages/runtime-3.7/src/core/AtlasAttachmentLoader.d.ts +20 -0
- package/dist/types/packages/runtime-3.7/src/core/Bone.d.ts +58 -0
- package/dist/types/packages/runtime-3.7/src/core/BoneData.d.ts +19 -0
- package/dist/types/packages/runtime-3.7/src/core/Constraint.d.ts +7 -0
- package/dist/types/packages/runtime-3.7/src/core/Event.d.ts +15 -0
- package/dist/types/packages/runtime-3.7/src/core/EventData.d.ts +14 -0
- package/dist/types/packages/runtime-3.7/src/core/IkConstraint.d.ts +27 -0
- package/dist/types/packages/runtime-3.7/src/core/IkConstraintData.d.ts +16 -0
- package/dist/types/packages/runtime-3.7/src/core/PathConstraint.d.ts +36 -0
- package/dist/types/packages/runtime-3.7/src/core/PathConstraintData.d.ts +29 -0
- package/dist/types/packages/runtime-3.7/src/core/Skeleton.d.ts +88 -0
- package/dist/types/packages/runtime-3.7/src/core/SkeletonBounds.d.ts +8 -0
- package/dist/types/packages/runtime-3.7/src/core/SkeletonData.d.ts +41 -0
- package/dist/types/packages/runtime-3.7/src/core/SkeletonJson.d.ts +27 -0
- package/dist/types/packages/runtime-3.7/src/core/Skin.d.ts +16 -0
- package/dist/types/packages/runtime-3.7/src/core/Slot.d.ts +27 -0
- package/dist/types/packages/runtime-3.7/src/core/SlotData.d.ts +17 -0
- package/dist/types/packages/runtime-3.7/src/core/TransformConstraint.d.ts +26 -0
- package/dist/types/packages/runtime-3.7/src/core/TransformConstraintData.d.ts +23 -0
- package/dist/types/packages/runtime-3.7/src/core/Updatable.d.ts +6 -0
- package/dist/types/packages/runtime-3.7/src/core/VertexEffect.d.ts +10 -0
- package/dist/types/packages/runtime-3.7/src/core/attachments/Attachment.d.ts +30 -0
- package/dist/types/packages/runtime-3.7/src/core/attachments/AttachmentLoader.d.ts +24 -0
- package/dist/types/packages/runtime-3.7/src/core/attachments/BoundingBoxAttachment.d.ts +10 -0
- package/dist/types/packages/runtime-3.7/src/core/attachments/ClippingAttachment.d.ts +12 -0
- package/dist/types/packages/runtime-3.7/src/core/attachments/MeshAttachment.d.ts +23 -0
- package/dist/types/packages/runtime-3.7/src/core/attachments/PathAttachment.d.ts +13 -0
- package/dist/types/packages/runtime-3.7/src/core/attachments/PointAttachment.d.ts +16 -0
- package/dist/types/packages/runtime-3.7/src/core/attachments/RegionAttachment.d.ts +68 -0
- package/dist/types/packages/runtime-3.7/src/core/attachments/index.d.ts +8 -0
- package/dist/types/packages/runtime-3.7/src/core/vertexeffects/JitterEffect.d.ts +14 -0
- package/dist/types/packages/runtime-3.7/src/core/vertexeffects/SwirlEffect.d.ts +19 -0
- package/dist/types/packages/runtime-3.7/src/index.d.ts +28 -0
- package/dist/types/packages/runtime-3.8/src/Spine.d.ts +11 -0
- package/dist/types/packages/runtime-3.8/src/core/Animation.d.ts +400 -0
- package/dist/types/packages/runtime-3.8/src/core/AnimationState.d.ts +401 -0
- package/dist/types/packages/runtime-3.8/src/core/AnimationStateData.d.ts +17 -0
- package/dist/types/packages/runtime-3.8/src/core/AtlasAttachmentLoader.d.ts +20 -0
- package/dist/types/packages/runtime-3.8/src/core/Bone.d.ts +58 -0
- package/dist/types/packages/runtime-3.8/src/core/BoneData.d.ts +21 -0
- package/dist/types/packages/runtime-3.8/src/core/Constraint.d.ts +9 -0
- package/dist/types/packages/runtime-3.8/src/core/Event.d.ts +15 -0
- package/dist/types/packages/runtime-3.8/src/core/EventData.d.ts +14 -0
- package/dist/types/packages/runtime-3.8/src/core/IkConstraint.d.ts +30 -0
- package/dist/types/packages/runtime-3.8/src/core/IkConstraintData.d.ts +17 -0
- package/dist/types/packages/runtime-3.8/src/core/PathConstraint.d.ts +37 -0
- package/dist/types/packages/runtime-3.8/src/core/PathConstraintData.d.ts +28 -0
- package/dist/types/packages/runtime-3.8/src/core/Skeleton.d.ts +88 -0
- package/dist/types/packages/runtime-3.8/src/core/SkeletonBinary.d.ts +43 -0
- package/dist/types/packages/runtime-3.8/src/core/SkeletonBounds.d.ts +8 -0
- package/dist/types/packages/runtime-3.8/src/core/SkeletonData.d.ts +44 -0
- package/dist/types/packages/runtime-3.8/src/core/SkeletonJson.d.ts +27 -0
- package/dist/types/packages/runtime-3.8/src/core/Skin.d.ts +35 -0
- package/dist/types/packages/runtime-3.8/src/core/Slot.d.ts +28 -0
- package/dist/types/packages/runtime-3.8/src/core/SlotData.d.ts +17 -0
- package/dist/types/packages/runtime-3.8/src/core/TransformConstraint.d.ts +27 -0
- package/dist/types/packages/runtime-3.8/src/core/TransformConstraintData.d.ts +22 -0
- package/dist/types/packages/runtime-3.8/src/core/Updatable.d.ts +7 -0
- package/dist/types/packages/runtime-3.8/src/core/VertexEffect.d.ts +10 -0
- package/dist/types/packages/runtime-3.8/src/core/attachments/Attachment.d.ts +32 -0
- package/dist/types/packages/runtime-3.8/src/core/attachments/AttachmentLoader.d.ts +24 -0
- package/dist/types/packages/runtime-3.8/src/core/attachments/BoundingBoxAttachment.d.ts +11 -0
- package/dist/types/packages/runtime-3.8/src/core/attachments/ClippingAttachment.d.ts +13 -0
- package/dist/types/packages/runtime-3.8/src/core/attachments/MeshAttachment.d.ts +25 -0
- package/dist/types/packages/runtime-3.8/src/core/attachments/PathAttachment.d.ts +14 -0
- package/dist/types/packages/runtime-3.8/src/core/attachments/PointAttachment.d.ts +17 -0
- package/dist/types/packages/runtime-3.8/src/core/attachments/RegionAttachment.d.ts +69 -0
- package/dist/types/packages/runtime-3.8/src/core/attachments/index.d.ts +8 -0
- package/dist/types/packages/runtime-3.8/src/core/vertexeffects/JitterEffect.d.ts +14 -0
- package/dist/types/packages/runtime-3.8/src/core/vertexeffects/SwirlEffect.d.ts +19 -0
- package/dist/types/packages/runtime-3.8/src/index.d.ts +29 -0
- package/dist/types/packages/runtime-4.0/src/Spine.d.ts +11 -0
- package/dist/types/packages/runtime-4.0/src/core/Animation.d.ts +366 -0
- package/dist/types/packages/runtime-4.0/src/core/AnimationState.d.ts +369 -0
- package/dist/types/packages/runtime-4.0/src/core/AnimationStateData.d.ts +25 -0
- package/dist/types/packages/runtime-4.0/src/core/AtlasAttachmentLoader.d.ts +20 -0
- package/dist/types/packages/runtime-4.0/src/core/Bone.d.ts +104 -0
- package/dist/types/packages/runtime-4.0/src/core/BoneData.d.ts +38 -0
- package/dist/types/packages/runtime-4.0/src/core/ConstraintData.d.ts +9 -0
- package/dist/types/packages/runtime-4.0/src/core/Event.d.ts +19 -0
- package/dist/types/packages/runtime-4.0/src/core/EventData.d.ts +16 -0
- package/dist/types/packages/runtime-4.0/src/core/IkConstraint.d.ts +38 -0
- package/dist/types/packages/runtime-4.0/src/core/IkConstraintData.d.ts +28 -0
- package/dist/types/packages/runtime-4.0/src/core/PathConstraint.d.ts +45 -0
- package/dist/types/packages/runtime-4.0/src/core/PathConstraintData.d.ts +42 -0
- package/dist/types/packages/runtime-4.0/src/core/Skeleton.d.ts +149 -0
- package/dist/types/packages/runtime-4.0/src/core/SkeletonBinary.d.ts +28 -0
- package/dist/types/packages/runtime-4.0/src/core/SkeletonBounds.d.ts +8 -0
- package/dist/types/packages/runtime-4.0/src/core/SkeletonData.d.ts +94 -0
- package/dist/types/packages/runtime-4.0/src/core/SkeletonJson.d.ts +26 -0
- package/dist/types/packages/runtime-4.0/src/core/Skin.d.ts +47 -0
- package/dist/types/packages/runtime-4.0/src/core/Slot.d.ts +45 -0
- package/dist/types/packages/runtime-4.0/src/core/SlotData.d.ts +26 -0
- package/dist/types/packages/runtime-4.0/src/core/TransformConstraint.d.ts +34 -0
- package/dist/types/packages/runtime-4.0/src/core/TransformConstraintData.d.ts +34 -0
- package/dist/types/packages/runtime-4.0/src/core/Updatable.d.ts +11 -0
- package/dist/types/packages/runtime-4.0/src/core/VertexEffect.d.ts +10 -0
- package/dist/types/packages/runtime-4.0/src/core/attachments/Attachment.d.ts +52 -0
- package/dist/types/packages/runtime-4.0/src/core/attachments/AttachmentLoader.d.ts +24 -0
- package/dist/types/packages/runtime-4.0/src/core/attachments/BoundingBoxAttachment.d.ts +11 -0
- package/dist/types/packages/runtime-4.0/src/core/attachments/ClippingAttachment.d.ts +15 -0
- package/dist/types/packages/runtime-4.0/src/core/attachments/MeshAttachment.d.ts +38 -0
- package/dist/types/packages/runtime-4.0/src/core/attachments/PathAttachment.d.ts +20 -0
- package/dist/types/packages/runtime-4.0/src/core/attachments/PointAttachment.d.ts +19 -0
- package/dist/types/packages/runtime-4.0/src/core/attachments/RegionAttachment.d.ts +89 -0
- package/dist/types/packages/runtime-4.0/src/core/attachments/index.d.ts +8 -0
- package/dist/types/packages/runtime-4.0/src/core/vertexeffects/JitterEffect.d.ts +14 -0
- package/dist/types/packages/runtime-4.0/src/core/vertexeffects/SwirlEffect.d.ts +19 -0
- package/dist/types/packages/runtime-4.0/src/index.d.ts +29 -0
- package/dist/types/packages/runtime-4.1/src/Spine.d.ts +11 -0
- package/dist/types/packages/runtime-4.1/src/core/Animation.d.ts +386 -0
- package/dist/types/packages/runtime-4.1/src/core/AnimationState.d.ts +371 -0
- package/dist/types/packages/runtime-4.1/src/core/AnimationStateData.d.ts +25 -0
- package/dist/types/packages/runtime-4.1/src/core/AtlasAttachmentLoader.d.ts +17 -0
- package/dist/types/packages/runtime-4.1/src/core/Bone.d.ts +104 -0
- package/dist/types/packages/runtime-4.1/src/core/BoneData.d.ts +38 -0
- package/dist/types/packages/runtime-4.1/src/core/ConstraintData.d.ts +9 -0
- package/dist/types/packages/runtime-4.1/src/core/Event.d.ts +19 -0
- package/dist/types/packages/runtime-4.1/src/core/EventData.d.ts +16 -0
- package/dist/types/packages/runtime-4.1/src/core/IkConstraint.d.ts +38 -0
- package/dist/types/packages/runtime-4.1/src/core/IkConstraintData.d.ts +30 -0
- package/dist/types/packages/runtime-4.1/src/core/PathConstraint.d.ts +45 -0
- package/dist/types/packages/runtime-4.1/src/core/PathConstraintData.d.ts +44 -0
- package/dist/types/packages/runtime-4.1/src/core/Skeleton.d.ts +143 -0
- package/dist/types/packages/runtime-4.1/src/core/SkeletonBinary.d.ts +31 -0
- package/dist/types/packages/runtime-4.1/src/core/SkeletonBounds.d.ts +8 -0
- package/dist/types/packages/runtime-4.1/src/core/SkeletonData.d.ts +94 -0
- package/dist/types/packages/runtime-4.1/src/core/SkeletonJson.d.ts +28 -0
- package/dist/types/packages/runtime-4.1/src/core/Skin.d.ts +47 -0
- package/dist/types/packages/runtime-4.1/src/core/Slot.d.ts +44 -0
- package/dist/types/packages/runtime-4.1/src/core/SlotData.d.ts +26 -0
- package/dist/types/packages/runtime-4.1/src/core/TransformConstraint.d.ts +34 -0
- package/dist/types/packages/runtime-4.1/src/core/TransformConstraintData.d.ts +36 -0
- package/dist/types/packages/runtime-4.1/src/core/Updatable.d.ts +11 -0
- package/dist/types/packages/runtime-4.1/src/core/attachments/Attachment.d.ts +53 -0
- package/dist/types/packages/runtime-4.1/src/core/attachments/AttachmentLoader.d.ts +25 -0
- package/dist/types/packages/runtime-4.1/src/core/attachments/BoundingBoxAttachment.d.ts +11 -0
- package/dist/types/packages/runtime-4.1/src/core/attachments/ClippingAttachment.d.ts +17 -0
- package/dist/types/packages/runtime-4.1/src/core/attachments/MeshAttachment.d.ts +42 -0
- package/dist/types/packages/runtime-4.1/src/core/attachments/PathAttachment.d.ts +20 -0
- package/dist/types/packages/runtime-4.1/src/core/attachments/PointAttachment.d.ts +19 -0
- package/dist/types/packages/runtime-4.1/src/core/attachments/RegionAttachment.d.ts +82 -0
- package/dist/types/packages/runtime-4.1/src/core/attachments/Sequence.d.ts +35 -0
- package/dist/types/packages/runtime-4.1/src/core/attachments/index.d.ts +9 -0
- package/dist/types/packages/runtime-4.1/src/index.d.ts +26 -0
- package/dist/types/packages/runtime-4.2/src/Spine.d.ts +11 -0
- package/dist/types/packages/runtime-4.2/src/core/Animation.d.ts +544 -0
- package/dist/types/packages/runtime-4.2/src/core/AnimationState.d.ts +405 -0
- package/dist/types/packages/runtime-4.2/src/core/AnimationStateData.d.ts +25 -0
- package/dist/types/packages/runtime-4.2/src/core/AtlasAttachmentLoader.d.ts +20 -0
- package/dist/types/packages/runtime-4.2/src/core/Bone.d.ts +117 -0
- package/dist/types/packages/runtime-4.2/src/core/BoneData.d.ts +42 -0
- package/dist/types/packages/runtime-4.2/src/core/ConstraintData.d.ts +9 -0
- package/dist/types/packages/runtime-4.2/src/core/Event.d.ts +18 -0
- package/dist/types/packages/runtime-4.2/src/core/EventData.d.ts +15 -0
- package/dist/types/packages/runtime-4.2/src/core/IkConstraint.d.ts +40 -0
- package/dist/types/packages/runtime-4.2/src/core/IkConstraintData.d.ts +30 -0
- package/dist/types/packages/runtime-4.2/src/core/PathConstraint.d.ts +47 -0
- package/dist/types/packages/runtime-4.2/src/core/PathConstraintData.d.ts +62 -0
- package/dist/types/packages/runtime-4.2/src/core/PhysicsConstraint.d.ts +54 -0
- package/dist/types/packages/runtime-4.2/src/core/PhysicsConstraintData.d.ts +35 -0
- package/dist/types/packages/runtime-4.2/src/core/Skeleton.d.ts +160 -0
- package/dist/types/packages/runtime-4.2/src/core/SkeletonBinary.d.ts +43 -0
- package/dist/types/packages/runtime-4.2/src/core/SkeletonBounds.d.ts +51 -0
- package/dist/types/packages/runtime-4.2/src/core/SkeletonClipping.d.ts +38 -0
- package/dist/types/packages/runtime-4.2/src/core/SkeletonData.d.ts +101 -0
- package/dist/types/packages/runtime-4.2/src/core/SkeletonJson.d.ts +23 -0
- package/dist/types/packages/runtime-4.2/src/core/Skin.d.ts +49 -0
- package/dist/types/packages/runtime-4.2/src/core/Slot.d.ts +44 -0
- package/dist/types/packages/runtime-4.2/src/core/SlotData.d.ts +28 -0
- package/dist/types/packages/runtime-4.2/src/core/TransformConstraint.d.ts +33 -0
- package/dist/types/packages/runtime-4.2/src/core/TransformConstraintData.d.ts +34 -0
- package/dist/types/packages/runtime-4.2/src/core/Triangulator.d.ts +18 -0
- package/dist/types/packages/runtime-4.2/src/core/Updatable.d.ts +16 -0
- package/dist/types/packages/runtime-4.2/src/core/attachments/Attachment.d.ts +49 -0
- package/dist/types/packages/runtime-4.2/src/core/attachments/AttachmentLoader.d.ts +27 -0
- package/dist/types/packages/runtime-4.2/src/core/attachments/BoundingBoxAttachment.d.ts +12 -0
- package/dist/types/packages/runtime-4.2/src/core/attachments/ClippingAttachment.d.ts +16 -0
- package/dist/types/packages/runtime-4.2/src/core/attachments/MeshAttachment.d.ts +46 -0
- package/dist/types/packages/runtime-4.2/src/core/attachments/PathAttachment.d.ts +19 -0
- package/dist/types/packages/runtime-4.2/src/core/attachments/PointAttachment.d.ts +20 -0
- package/dist/types/packages/runtime-4.2/src/core/attachments/RegionAttachment.d.ts +80 -0
- package/dist/types/packages/runtime-4.2/src/core/attachments/Sequence.d.ts +35 -0
- package/dist/types/packages/runtime-4.2/src/core/attachments/index.d.ts +9 -0
- package/dist/types/packages/runtime-4.2/src/core/index.d.ts +29 -0
- package/dist/types/packages/runtime-4.2/src/core/polyfills.d.ts +1 -0
- package/dist/types/packages/runtime-4.2/src/index.d.ts +3 -0
- package/dist/types/src/BinaryInput.d.ts +84 -0
- package/dist/types/src/SkelToJson.d.ts +15 -0
- package/dist/types/src/SkelToJson21.d.ts +10 -0
- package/dist/types/src/SkelToJson34And35.d.ts +10 -0
- package/dist/types/src/SkelToJson36And37.d.ts +10 -0
- package/dist/types/src/SkelToJsonCommon.d.ts +24 -0
- package/dist/types/src/TextureHelper.d.ts +29 -0
- package/dist/types/src/VersionDetector.d.ts +28 -0
- package/dist/types/src/index.d.ts +80 -0
- package/dist/types/src/types.d.ts +161 -0
- package/package.json +29 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Animation } from './Animation';
|
|
2
|
+
import { BoneData } from './BoneData.js';
|
|
3
|
+
import { EventData } from './EventData.js';
|
|
4
|
+
import { IkConstraintData } from './IkConstraintData.js';
|
|
5
|
+
import { PathConstraintData } from './PathConstraintData.js';
|
|
6
|
+
import { PhysicsConstraintData } from './PhysicsConstraintData.js';
|
|
7
|
+
import { Skin } from './Skin.js';
|
|
8
|
+
import { SlotData } from './SlotData.js';
|
|
9
|
+
import { TransformConstraintData } from './TransformConstraintData.js';
|
|
10
|
+
import type { ISkeletonData } from '@pixi-spine/base';
|
|
11
|
+
/** Stores the setup pose and all of the stateless data for a skeleton.
|
|
12
|
+
* @public
|
|
13
|
+
* See [Data objects](http://esotericsoftware.com/spine-runtime-architecture#Data-objects) in the Spine Runtimes
|
|
14
|
+
* Guide. */
|
|
15
|
+
export declare class SkeletonData implements ISkeletonData<BoneData, SlotData, Skin, Animation, EventData, IkConstraintData, TransformConstraintData, PathConstraintData> {
|
|
16
|
+
/** The skeleton's name, which by default is the name of the skeleton data file, if possible. May be null. */
|
|
17
|
+
name: string | null;
|
|
18
|
+
/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */
|
|
19
|
+
bones: BoneData[];
|
|
20
|
+
/** The skeleton's slots in the setup pose draw order. */
|
|
21
|
+
slots: SlotData[];
|
|
22
|
+
skins: Skin[];
|
|
23
|
+
/** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine.
|
|
24
|
+
*
|
|
25
|
+
* See {@link Skeleton#getAttachmentByName()}.
|
|
26
|
+
* May be null. */
|
|
27
|
+
defaultSkin: Skin | null;
|
|
28
|
+
/** The skeleton's events. */
|
|
29
|
+
events: EventData[];
|
|
30
|
+
/** The skeleton's animations. */
|
|
31
|
+
animations: Animation[];
|
|
32
|
+
/** The skeleton's IK constraints. */
|
|
33
|
+
ikConstraints: IkConstraintData[];
|
|
34
|
+
/** The skeleton's transform constraints. */
|
|
35
|
+
transformConstraints: TransformConstraintData[];
|
|
36
|
+
/** The skeleton's path constraints. */
|
|
37
|
+
pathConstraints: PathConstraintData[];
|
|
38
|
+
/** The skeleton's physics constraints. */
|
|
39
|
+
physicsConstraints: PhysicsConstraintData[];
|
|
40
|
+
/** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */
|
|
41
|
+
x: number;
|
|
42
|
+
/** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */
|
|
43
|
+
y: number;
|
|
44
|
+
/** The width of the skeleton's axis aligned bounding box in the setup pose. */
|
|
45
|
+
width: number;
|
|
46
|
+
/** The height of the skeleton's axis aligned bounding box in the setup pose. */
|
|
47
|
+
height: number;
|
|
48
|
+
/** Baseline scale factor for applying distance-dependent effects on non-scalable properties, such as angle or scale. Default
|
|
49
|
+
* is 100. */
|
|
50
|
+
referenceScale: number;
|
|
51
|
+
/** The Spine version used to export the skeleton data, or null. */
|
|
52
|
+
version: string | null;
|
|
53
|
+
/** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */
|
|
54
|
+
hash: string | null;
|
|
55
|
+
/** The dopesheet FPS in Spine. Available only when nonessential data was exported. */
|
|
56
|
+
fps: number;
|
|
57
|
+
/** The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null. */
|
|
58
|
+
imagesPath: string | null;
|
|
59
|
+
/** The path to the audio directory as defined in Spine. Available only when nonessential data was exported. May be null. */
|
|
60
|
+
audioPath: string | null;
|
|
61
|
+
/** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it
|
|
62
|
+
* multiple times.
|
|
63
|
+
* @returns May be null. */
|
|
64
|
+
findBone(boneName: string): BoneData;
|
|
65
|
+
/** removed from spine-ts runtime **/
|
|
66
|
+
findBoneIndex(boneName: string): number;
|
|
67
|
+
/** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it
|
|
68
|
+
* multiple times.
|
|
69
|
+
* @returns May be null. */
|
|
70
|
+
findSlot(slotName: string): SlotData;
|
|
71
|
+
/** removed from spine-ts runtime **/
|
|
72
|
+
findSlotIndex(slotName: string): number;
|
|
73
|
+
/** Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it
|
|
74
|
+
* multiple times.
|
|
75
|
+
* @returns May be null. */
|
|
76
|
+
findSkin(skinName: string): Skin;
|
|
77
|
+
/** Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it
|
|
78
|
+
* multiple times.
|
|
79
|
+
* @returns May be null. */
|
|
80
|
+
findEvent(eventDataName: string): EventData;
|
|
81
|
+
/** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to
|
|
82
|
+
* call it multiple times.
|
|
83
|
+
* @returns May be null. */
|
|
84
|
+
findAnimation(animationName: string): Animation;
|
|
85
|
+
/** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method
|
|
86
|
+
* than to call it multiple times.
|
|
87
|
+
* @return May be null. */
|
|
88
|
+
findIkConstraint(constraintName: string): IkConstraintData;
|
|
89
|
+
/** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of
|
|
90
|
+
* this method than to call it multiple times.
|
|
91
|
+
* @return May be null. */
|
|
92
|
+
findTransformConstraint(constraintName: string): TransformConstraintData;
|
|
93
|
+
/** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method
|
|
94
|
+
* than to call it multiple times.
|
|
95
|
+
* @return May be null. */
|
|
96
|
+
findPathConstraint(constraintName: string): PathConstraintData;
|
|
97
|
+
/** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this method
|
|
98
|
+
* than to call it multiple times.
|
|
99
|
+
* @return May be null. */
|
|
100
|
+
findPhysicsConstraint(constraintName: string): PhysicsConstraintData;
|
|
101
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Attachment, AttachmentLoader, Sequence, VertexAttachment } from './attachments';
|
|
2
|
+
import { SkeletonData } from './SkeletonData.js';
|
|
3
|
+
import { Skin } from './Skin.js';
|
|
4
|
+
/** Loads skeleton data in the Spine JSON format.
|
|
5
|
+
* @public
|
|
6
|
+
* See [Spine JSON format](http://esotericsoftware.com/spine-json-format) and
|
|
7
|
+
* [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine
|
|
8
|
+
* Runtimes Guide. */
|
|
9
|
+
export declare class SkeletonJson {
|
|
10
|
+
attachmentLoader: AttachmentLoader;
|
|
11
|
+
/** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at
|
|
12
|
+
* runtime than were used in Spine.
|
|
13
|
+
*
|
|
14
|
+
* See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */
|
|
15
|
+
scale: number;
|
|
16
|
+
private linkedMeshes;
|
|
17
|
+
constructor(attachmentLoader: AttachmentLoader);
|
|
18
|
+
readSkeletonData(json: string | any): SkeletonData;
|
|
19
|
+
readAttachment(map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment | null;
|
|
20
|
+
readSequence(map: any): Sequence;
|
|
21
|
+
readVertices(map: any, attachment: VertexAttachment, verticesLength: number): void;
|
|
22
|
+
readAnimation(map: any, name: string, skeletonData: SkeletonData): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Attachment } from './attachments/Attachment.js';
|
|
2
|
+
import { BoneData } from './BoneData.js';
|
|
3
|
+
import { ConstraintData } from './ConstraintData.js';
|
|
4
|
+
import { Skeleton } from './Skeleton.js';
|
|
5
|
+
import { type ISkin, type StringMap, Color } from '@pixi-spine/base';
|
|
6
|
+
/** Stores an entry in the skin consisting of the slot index, name, and attachment
|
|
7
|
+
* @public
|
|
8
|
+
* */
|
|
9
|
+
export declare class SkinEntry {
|
|
10
|
+
slotIndex: number;
|
|
11
|
+
name: string;
|
|
12
|
+
attachment: Attachment;
|
|
13
|
+
constructor(slotIndex: number, name: string, attachment: Attachment);
|
|
14
|
+
}
|
|
15
|
+
/** Stores attachments by slot index and attachment name.
|
|
16
|
+
*
|
|
17
|
+
* See SkeletonData {@link SkeletonData#defaultSkin}, Skeleton {@link Skeleton#skin}, and
|
|
18
|
+
* [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide.
|
|
19
|
+
* @public
|
|
20
|
+
* */
|
|
21
|
+
export declare class Skin implements ISkin {
|
|
22
|
+
/** The skin's name, which is unique across all skins in the skeleton. */
|
|
23
|
+
name: string;
|
|
24
|
+
attachments: StringMap<Attachment>[];
|
|
25
|
+
bones: BoneData[];
|
|
26
|
+
constraints: ConstraintData[];
|
|
27
|
+
/** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */
|
|
28
|
+
color: Color;
|
|
29
|
+
constructor(name: string);
|
|
30
|
+
/** Adds an attachment to the skin for the specified slot index and name. */
|
|
31
|
+
setAttachment(slotIndex: number, name: string, attachment: Attachment): void;
|
|
32
|
+
/** Adds all attachments, bones, and constraints from the specified skin to this skin. */
|
|
33
|
+
addSkin(skin: Skin): void;
|
|
34
|
+
/** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not
|
|
35
|
+
* copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */
|
|
36
|
+
copySkin(skin: Skin): void;
|
|
37
|
+
/** Returns the attachment for the specified slot index and name, or null. */
|
|
38
|
+
getAttachment(slotIndex: number, name: string): Attachment | null;
|
|
39
|
+
/** Removes the attachment in the skin for the specified slot index and name, if any. */
|
|
40
|
+
removeAttachment(slotIndex: number, name: string): void;
|
|
41
|
+
/** Returns all attachments in this skin. */
|
|
42
|
+
getAttachments(): Array<SkinEntry>;
|
|
43
|
+
/** Returns all attachments in this skin for the specified slot index. */
|
|
44
|
+
getAttachmentsForSlot(slotIndex: number, attachments: Array<SkinEntry>): void;
|
|
45
|
+
/** Clears all attachments, bones, and constraints. */
|
|
46
|
+
clear(): void;
|
|
47
|
+
/** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */
|
|
48
|
+
attachAll(skeleton: Skeleton, oldSkin: Skin): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Attachment } from './attachments/Attachment.js';
|
|
2
|
+
import { Bone } from './Bone.js';
|
|
3
|
+
import { Skeleton } from './Skeleton.js';
|
|
4
|
+
import { SlotData } from './SlotData.js';
|
|
5
|
+
import { Color, ISlot } from '@pixi-spine/base';
|
|
6
|
+
/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store
|
|
7
|
+
* state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
|
|
8
|
+
* across multiple skeletons.
|
|
9
|
+
* @public
|
|
10
|
+
* */
|
|
11
|
+
export declare class Slot implements ISlot {
|
|
12
|
+
blendMode: number;
|
|
13
|
+
/** The slot's setup pose data. */
|
|
14
|
+
data: SlotData;
|
|
15
|
+
/** The bone this slot belongs to. */
|
|
16
|
+
bone: Bone;
|
|
17
|
+
/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
|
|
18
|
+
* color tinting. */
|
|
19
|
+
color: Color;
|
|
20
|
+
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
|
|
21
|
+
* color's alpha is not used. */
|
|
22
|
+
darkColor: Color | null;
|
|
23
|
+
attachment: Attachment | null;
|
|
24
|
+
attachmentState: number;
|
|
25
|
+
/** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the
|
|
26
|
+
* {@link Sequence#getSetupIndex()}. */
|
|
27
|
+
sequenceIndex: number;
|
|
28
|
+
/** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
|
|
29
|
+
* weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
|
|
30
|
+
*
|
|
31
|
+
* See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */
|
|
32
|
+
deform: number[];
|
|
33
|
+
constructor(data: SlotData, bone: Bone);
|
|
34
|
+
/** The skeleton this slot belongs to. */
|
|
35
|
+
getSkeleton(): Skeleton;
|
|
36
|
+
/** The current attachment for the slot, or null if the slot has no attachment. */
|
|
37
|
+
getAttachment(): Attachment | null;
|
|
38
|
+
/** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.
|
|
39
|
+
* The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the
|
|
40
|
+
* specified attachment. */
|
|
41
|
+
setAttachment(attachment: Attachment | null): void;
|
|
42
|
+
/** Sets this slot to the setup pose. */
|
|
43
|
+
setToSetupPose(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BLEND_MODES } from '@pixi-spine/base';
|
|
2
|
+
import { BoneData } from './BoneData.js';
|
|
3
|
+
import { Color } from '@pixi-spine/base';
|
|
4
|
+
import type { ISlotData } from '@pixi-spine/base';
|
|
5
|
+
/** Stores the setup pose for a {@link Slot}.
|
|
6
|
+
* @public
|
|
7
|
+
* */
|
|
8
|
+
export declare class SlotData implements ISlotData {
|
|
9
|
+
/** The index of the slot in {@link Skeleton#getSlots()}. */
|
|
10
|
+
index: number;
|
|
11
|
+
/** The name of the slot, which is unique across all slots in the skeleton. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** The bone this slot belongs to. */
|
|
14
|
+
boneData: BoneData;
|
|
15
|
+
/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
|
|
16
|
+
* color tinting. */
|
|
17
|
+
color: Color;
|
|
18
|
+
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
|
|
19
|
+
* color's alpha is not used. */
|
|
20
|
+
darkColor: Color | null;
|
|
21
|
+
/** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */
|
|
22
|
+
attachmentName: string | null;
|
|
23
|
+
/** The blend mode for drawing the slot's attachment. */
|
|
24
|
+
blendMode: BLEND_MODES;
|
|
25
|
+
/** False if the slot was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */
|
|
26
|
+
visible: boolean;
|
|
27
|
+
constructor(index: number, name: string, boneData: BoneData);
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Bone } from './Bone.js';
|
|
2
|
+
import { Skeleton } from './Skeleton.js';
|
|
3
|
+
import { TransformConstraintData } from './TransformConstraintData.js';
|
|
4
|
+
import { Updatable } from './Updatable.js';
|
|
5
|
+
import { Physics, Vector2 } from '@pixi-spine/base';
|
|
6
|
+
/** Stores the current pose for a transform constraint. A transform constraint adjusts the world transform of the constrained
|
|
7
|
+
* bones to match that of the target bone.
|
|
8
|
+
* @public
|
|
9
|
+
* See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */
|
|
10
|
+
export declare class TransformConstraint implements Updatable {
|
|
11
|
+
/** The transform constraint's setup pose data. */
|
|
12
|
+
data: TransformConstraintData;
|
|
13
|
+
/** The bones that will be modified by this transform constraint. */
|
|
14
|
+
bones: Array<Bone>;
|
|
15
|
+
/** The target bone whose world transform will be copied to the constrained bones. */
|
|
16
|
+
target: Bone;
|
|
17
|
+
mixRotate: number;
|
|
18
|
+
mixX: number;
|
|
19
|
+
mixY: number;
|
|
20
|
+
mixScaleX: number;
|
|
21
|
+
mixScaleY: number;
|
|
22
|
+
mixShearY: number;
|
|
23
|
+
temp: Vector2;
|
|
24
|
+
active: boolean;
|
|
25
|
+
constructor(data: TransformConstraintData, skeleton: Skeleton);
|
|
26
|
+
isActive(): boolean;
|
|
27
|
+
setToSetupPose(): void;
|
|
28
|
+
update(physics: Physics): void;
|
|
29
|
+
applyAbsoluteWorld(): void;
|
|
30
|
+
applyRelativeWorld(): void;
|
|
31
|
+
applyAbsoluteLocal(): void;
|
|
32
|
+
applyRelativeLocal(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BoneData } from './BoneData.js';
|
|
2
|
+
import { ConstraintData } from './ConstraintData.js';
|
|
3
|
+
/** Stores the setup pose for a {@link TransformConstraint}.
|
|
4
|
+
* @public
|
|
5
|
+
* See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */
|
|
6
|
+
export declare class TransformConstraintData extends ConstraintData {
|
|
7
|
+
/** The bones that will be modified by this transform constraint. */
|
|
8
|
+
bones: BoneData[];
|
|
9
|
+
/** The target bone whose world transform will be copied to the constrained bones. */
|
|
10
|
+
private _target;
|
|
11
|
+
set target(boneData: BoneData);
|
|
12
|
+
get target(): BoneData;
|
|
13
|
+
mixRotate: number;
|
|
14
|
+
mixX: number;
|
|
15
|
+
mixY: number;
|
|
16
|
+
mixScaleX: number;
|
|
17
|
+
mixScaleY: number;
|
|
18
|
+
mixShearY: number;
|
|
19
|
+
/** An offset added to the constrained bone rotation. */
|
|
20
|
+
offsetRotation: number;
|
|
21
|
+
/** An offset added to the constrained bone X translation. */
|
|
22
|
+
offsetX: number;
|
|
23
|
+
/** An offset added to the constrained bone Y translation. */
|
|
24
|
+
offsetY: number;
|
|
25
|
+
/** An offset added to the constrained bone scaleX. */
|
|
26
|
+
offsetScaleX: number;
|
|
27
|
+
/** An offset added to the constrained bone scaleY. */
|
|
28
|
+
offsetScaleY: number;
|
|
29
|
+
/** An offset added to the constrained bone shearY. */
|
|
30
|
+
offsetShearY: number;
|
|
31
|
+
relative: boolean;
|
|
32
|
+
local: boolean;
|
|
33
|
+
constructor(name: string);
|
|
34
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NumberArrayLike } from '@pixi-spine/base';
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
* */
|
|
5
|
+
export declare class Triangulator {
|
|
6
|
+
private convexPolygons;
|
|
7
|
+
private convexPolygonsIndices;
|
|
8
|
+
private indicesArray;
|
|
9
|
+
private isConcaveArray;
|
|
10
|
+
private triangles;
|
|
11
|
+
private polygonPool;
|
|
12
|
+
private polygonIndicesPool;
|
|
13
|
+
triangulate(verticesArray: NumberArrayLike): Array<number>;
|
|
14
|
+
decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
|
|
15
|
+
private static isConcave;
|
|
16
|
+
private static positiveArea;
|
|
17
|
+
private static winding;
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Physics } from '@pixi-spine/base';
|
|
2
|
+
/** The interface for items updated by {@link Skeleton#updateWorldTransform()}.
|
|
3
|
+
* @public
|
|
4
|
+
* */
|
|
5
|
+
export interface Updatable {
|
|
6
|
+
/** @param physics Determines how physics and other non-deterministic updates are applied. */
|
|
7
|
+
update(physics: Physics): void;
|
|
8
|
+
/** Returns false when this item won't be updated by
|
|
9
|
+
* {@link Skeleton#updateWorldTransform()} because a skin is required and the
|
|
10
|
+
* {@link Skeleton#getSkin() active skin} does not contain this item.
|
|
11
|
+
* @see Skin#getBones()
|
|
12
|
+
* @see Skin#getConstraints()
|
|
13
|
+
* @see BoneData#getSkinRequired()
|
|
14
|
+
* @see ConstraintData#getSkinRequired() */
|
|
15
|
+
isActive(): boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Slot } from '../Slot.js';
|
|
2
|
+
import { type IAttachment, AttachmentType, NumberArrayLike } from '@pixi-spine/base';
|
|
3
|
+
/** The base class for all attachments.
|
|
4
|
+
* @public
|
|
5
|
+
* */
|
|
6
|
+
export declare abstract class Attachment implements IAttachment {
|
|
7
|
+
name: string;
|
|
8
|
+
type: AttachmentType;
|
|
9
|
+
constructor(name: string);
|
|
10
|
+
abstract copy(): Attachment;
|
|
11
|
+
}
|
|
12
|
+
/** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's
|
|
13
|
+
* @public
|
|
14
|
+
* {@link Slot#deform}. */
|
|
15
|
+
export declare abstract class VertexAttachment extends Attachment {
|
|
16
|
+
private static nextID;
|
|
17
|
+
/** The unique ID for this attachment. */
|
|
18
|
+
id: number;
|
|
19
|
+
/** The bones which affect the {@link #getVertices()}. The array entries are, for each vertex, the number of bones affecting
|
|
20
|
+
* the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#bones}. Will be null
|
|
21
|
+
* if this attachment has no weights. */
|
|
22
|
+
bones: Array<number> | null;
|
|
23
|
+
/** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y`
|
|
24
|
+
* entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting
|
|
25
|
+
* each vertex. */
|
|
26
|
+
vertices: NumberArrayLike;
|
|
27
|
+
/** The maximum number of world vertex values that can be output by
|
|
28
|
+
* {@link #computeWorldVertices()} using the `count` parameter. */
|
|
29
|
+
worldVerticesLength: number;
|
|
30
|
+
/** Timelines for the timeline attachment are also applied to this attachment.
|
|
31
|
+
* May be null if no attachment-specific timelines should be applied. */
|
|
32
|
+
timelineAttachment: Attachment;
|
|
33
|
+
constructor(name: string);
|
|
34
|
+
computeWorldVerticesOld(slot: Slot, worldVertices: ArrayLike<number>): void;
|
|
35
|
+
/** Transforms the attachment's local {@link #vertices} to world coordinates. If the slot's {@link Slot#deform} is
|
|
36
|
+
* not empty, it is used to deform the vertices.
|
|
37
|
+
*
|
|
38
|
+
* See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine
|
|
39
|
+
* Runtimes Guide.
|
|
40
|
+
* @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y.
|
|
41
|
+
* @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - `start`.
|
|
42
|
+
* @param worldVertices The output world vertices. Must have a length >= `offset` + `count` *
|
|
43
|
+
* `stride` / 2.
|
|
44
|
+
* @param offset The `worldVertices` index to begin writing values.
|
|
45
|
+
* @param stride The number of `worldVertices` entries between the value pairs written. */
|
|
46
|
+
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: NumberArrayLike, offset: number, stride: number): void;
|
|
47
|
+
/** Does not copy id (generated) or name (set on construction). **/
|
|
48
|
+
copyTo(attachment: VertexAttachment): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Skin } from '../Skin.js';
|
|
2
|
+
import { BoundingBoxAttachment } from './BoundingBoxAttachment.js';
|
|
3
|
+
import { ClippingAttachment } from './ClippingAttachment.js';
|
|
4
|
+
import { MeshAttachment } from './MeshAttachment.js';
|
|
5
|
+
import { PathAttachment } from './PathAttachment.js';
|
|
6
|
+
import { PointAttachment } from './PointAttachment.js';
|
|
7
|
+
import { RegionAttachment } from './RegionAttachment.js';
|
|
8
|
+
import { Sequence } from './Sequence.js';
|
|
9
|
+
/** The interface which can be implemented to customize creating and populating attachments.
|
|
10
|
+
* See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#AttachmentLoader) in the Spine
|
|
11
|
+
* Runtimes Guide.
|
|
12
|
+
* @public
|
|
13
|
+
* */
|
|
14
|
+
export interface AttachmentLoader {
|
|
15
|
+
/** @return May be null to not load an attachment. */
|
|
16
|
+
newRegionAttachment(skin: Skin, name: string, path: string, sequence: Sequence | null): RegionAttachment;
|
|
17
|
+
/** @return May be null to not load an attachment. */
|
|
18
|
+
newMeshAttachment(skin: Skin, name: string, path: string, sequence: Sequence | null): MeshAttachment;
|
|
19
|
+
/** @return May be null to not load an attachment. */
|
|
20
|
+
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
|
21
|
+
/** @return May be null to not load an attachment */
|
|
22
|
+
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
|
23
|
+
/** @return May be null to not load an attachment */
|
|
24
|
+
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
|
25
|
+
/** @return May be null to not load an attachment */
|
|
26
|
+
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Attachment, VertexAttachment } from './Attachment.js';
|
|
2
|
+
import { Color } from '@pixi-spine/base';
|
|
3
|
+
/** An attachment with vertices that make up a polygon. Can be used for hit detection, creating physics bodies, spawning particle
|
|
4
|
+
* effects, and more.
|
|
5
|
+
* @public
|
|
6
|
+
* See {@link SkeletonBounds} and [Bounding Boxes](http://esotericsoftware.com/spine-bounding-boxes) in the Spine User
|
|
7
|
+
* Guide. */
|
|
8
|
+
export declare class BoundingBoxAttachment extends VertexAttachment {
|
|
9
|
+
color: Color;
|
|
10
|
+
constructor(name: string);
|
|
11
|
+
copy(): Attachment;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SlotData } from '../SlotData.js';
|
|
2
|
+
import { Attachment, VertexAttachment } from './Attachment.js';
|
|
3
|
+
import { Color } from '@pixi-spine/base';
|
|
4
|
+
/** An attachment with vertices that make up a polygon used for clipping the rendering of other attachments.
|
|
5
|
+
* @public
|
|
6
|
+
* */
|
|
7
|
+
export declare class ClippingAttachment extends VertexAttachment {
|
|
8
|
+
/** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of
|
|
9
|
+
* the skeleton's rendering. */
|
|
10
|
+
endSlot: SlotData | null;
|
|
11
|
+
/** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons
|
|
12
|
+
* are not usually rendered at runtime. */
|
|
13
|
+
color: Color;
|
|
14
|
+
constructor(name: string);
|
|
15
|
+
copy(): Attachment;
|
|
16
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Slot } from '../Slot.js';
|
|
2
|
+
import { Attachment, VertexAttachment } from './Attachment.js';
|
|
3
|
+
import { Sequence } from './Sequence.js';
|
|
4
|
+
import { Color, IHasTextureRegion, IMeshAttachment, NumberArrayLike, TextureRegion } from '@pixi-spine/base';
|
|
5
|
+
/** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not
|
|
6
|
+
* supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.
|
|
7
|
+
* @public
|
|
8
|
+
* See [Mesh attachments](http://esotericsoftware.com/spine-meshes) in the Spine User Guide. */
|
|
9
|
+
export declare class MeshAttachment extends VertexAttachment implements IMeshAttachment, IHasTextureRegion {
|
|
10
|
+
region: TextureRegion | null;
|
|
11
|
+
/** The name of the texture region for this attachment. */
|
|
12
|
+
path: string;
|
|
13
|
+
/** The UV pair for each vertex, normalized within the texture region. */
|
|
14
|
+
regionUVs: Float32Array;
|
|
15
|
+
/** The UV pair for each vertex, normalized within the entire texture.
|
|
16
|
+
*
|
|
17
|
+
* See {@link #updateUVs}. */
|
|
18
|
+
uvs: NumberArrayLike;
|
|
19
|
+
/** Triplets of vertex indices which describe the mesh's triangulation. */
|
|
20
|
+
triangles: Array<number>;
|
|
21
|
+
/** The color to tint the mesh. */
|
|
22
|
+
color: Color;
|
|
23
|
+
/** The width of the mesh's image. Available only when nonessential data was exported. */
|
|
24
|
+
width: number;
|
|
25
|
+
/** The height of the mesh's image. Available only when nonessential data was exported. */
|
|
26
|
+
height: number;
|
|
27
|
+
/** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */
|
|
28
|
+
hullLength: number;
|
|
29
|
+
/** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if
|
|
30
|
+
* nonessential data was exported. Triangulation is not performed at runtime. */
|
|
31
|
+
edges: Array<number>;
|
|
32
|
+
private parentMesh;
|
|
33
|
+
sequence: Sequence | null;
|
|
34
|
+
tempColor: Color;
|
|
35
|
+
constructor(name: string, path: string);
|
|
36
|
+
/** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},
|
|
37
|
+
* {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the
|
|
38
|
+
* parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */
|
|
39
|
+
getParentMesh(): MeshAttachment;
|
|
40
|
+
/** @param parentMesh May be null. */
|
|
41
|
+
setParentMesh(parentMesh: MeshAttachment): void;
|
|
42
|
+
copy(): Attachment;
|
|
43
|
+
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: NumberArrayLike, offset: number, stride: number): void;
|
|
44
|
+
/** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/
|
|
45
|
+
newLinkedMesh(): MeshAttachment;
|
|
46
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Attachment, VertexAttachment } from './Attachment.js';
|
|
2
|
+
import { Color } from '@pixi-spine/base';
|
|
3
|
+
/** An attachment whose vertices make up a composite Bezier curve.
|
|
4
|
+
* @public
|
|
5
|
+
* See {@link PathConstraint} and [Paths](http://esotericsoftware.com/spine-paths) in the Spine User Guide. */
|
|
6
|
+
export declare class PathAttachment extends VertexAttachment {
|
|
7
|
+
/** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */
|
|
8
|
+
lengths: Array<number>;
|
|
9
|
+
/** If true, the start and end knots are connected. */
|
|
10
|
+
closed: boolean;
|
|
11
|
+
/** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer
|
|
12
|
+
* calculations are performed but calculating positions along the path is less accurate. */
|
|
13
|
+
constantSpeed: boolean;
|
|
14
|
+
/** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually
|
|
15
|
+
* rendered at runtime. */
|
|
16
|
+
color: Color;
|
|
17
|
+
constructor(name: string);
|
|
18
|
+
copy(): Attachment;
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Bone } from '../Bone.js';
|
|
2
|
+
import { Attachment, VertexAttachment } from './Attachment.js';
|
|
3
|
+
import { Color, Vector2 } from '@pixi-spine/base';
|
|
4
|
+
/** An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be
|
|
5
|
+
* used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a
|
|
6
|
+
* skin.
|
|
7
|
+
* @public
|
|
8
|
+
* See [Point Attachments](http://esotericsoftware.com/spine-point-attachments) in the Spine User Guide. */
|
|
9
|
+
export declare class PointAttachment extends VertexAttachment {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
rotation: number;
|
|
13
|
+
/** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments
|
|
14
|
+
* are not usually rendered at runtime. */
|
|
15
|
+
color: Color;
|
|
16
|
+
constructor(name: string);
|
|
17
|
+
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
|
18
|
+
computeWorldRotation(bone: Bone): number;
|
|
19
|
+
copy(): Attachment;
|
|
20
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Slot } from '../Slot.js';
|
|
2
|
+
import { Attachment } from './Attachment.js';
|
|
3
|
+
import { Sequence } from './Sequence.js';
|
|
4
|
+
import { Color, IHasTextureRegion, IRegionAttachment, NumberArrayLike, TextureRegion } from '@pixi-spine/base';
|
|
5
|
+
/** An attachment that displays a textured quadrilateral.
|
|
6
|
+
* @public
|
|
7
|
+
* See [Region attachments](http://esotericsoftware.com/spine-regions) in the Spine User Guide. */
|
|
8
|
+
export declare class RegionAttachment extends Attachment implements IRegionAttachment, IHasTextureRegion {
|
|
9
|
+
/** The local x translation. */
|
|
10
|
+
x: number;
|
|
11
|
+
/** The local y translation. */
|
|
12
|
+
y: number;
|
|
13
|
+
/** The local scaleX. */
|
|
14
|
+
scaleX: number;
|
|
15
|
+
/** The local scaleY. */
|
|
16
|
+
scaleY: number;
|
|
17
|
+
/** The local rotation. */
|
|
18
|
+
rotation: number;
|
|
19
|
+
/** The width of the region attachment in Spine. */
|
|
20
|
+
width: number;
|
|
21
|
+
/** The height of the region attachment in Spine. */
|
|
22
|
+
height: number;
|
|
23
|
+
/** The color to tint the region attachment. */
|
|
24
|
+
color: Color;
|
|
25
|
+
/** The name of the texture region for this attachment. */
|
|
26
|
+
path: string;
|
|
27
|
+
region: TextureRegion | null;
|
|
28
|
+
sequence: Sequence | null;
|
|
29
|
+
/** For each of the 4 vertices, a pair of <code>x,y</code> values that is the local position of the vertex.
|
|
30
|
+
*
|
|
31
|
+
* See {@link #updateOffset()}. */
|
|
32
|
+
offset: NumberArrayLike;
|
|
33
|
+
uvs: NumberArrayLike;
|
|
34
|
+
tempColor: Color;
|
|
35
|
+
constructor(name: string, path: string);
|
|
36
|
+
/** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */
|
|
37
|
+
updateRegion(): void;
|
|
38
|
+
/** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may
|
|
39
|
+
* be changed.
|
|
40
|
+
* <p>
|
|
41
|
+
* See <a href="http://esotericsoftware.com/spine-runtime-skeletons#World-transforms">World transforms</a> in the Spine
|
|
42
|
+
* Runtimes Guide.
|
|
43
|
+
* @param worldVertices The output world vertices. Must have a length >= <code>offset</code> + 8.
|
|
44
|
+
* @param offset The <code>worldVertices</code> index to begin writing values.
|
|
45
|
+
* @param stride The number of <code>worldVertices</code> entries between the value pairs written. */
|
|
46
|
+
computeWorldVertices(slot: Slot, worldVertices: NumberArrayLike, offset: number, stride: number): void;
|
|
47
|
+
copy(): Attachment;
|
|
48
|
+
static X1: number;
|
|
49
|
+
static Y1: number;
|
|
50
|
+
static C1R: number;
|
|
51
|
+
static C1G: number;
|
|
52
|
+
static C1B: number;
|
|
53
|
+
static C1A: number;
|
|
54
|
+
static U1: number;
|
|
55
|
+
static V1: number;
|
|
56
|
+
static X2: number;
|
|
57
|
+
static Y2: number;
|
|
58
|
+
static C2R: number;
|
|
59
|
+
static C2G: number;
|
|
60
|
+
static C2B: number;
|
|
61
|
+
static C2A: number;
|
|
62
|
+
static U2: number;
|
|
63
|
+
static V2: number;
|
|
64
|
+
static X3: number;
|
|
65
|
+
static Y3: number;
|
|
66
|
+
static C3R: number;
|
|
67
|
+
static C3G: number;
|
|
68
|
+
static C3B: number;
|
|
69
|
+
static C3A: number;
|
|
70
|
+
static U3: number;
|
|
71
|
+
static V3: number;
|
|
72
|
+
static X4: number;
|
|
73
|
+
static Y4: number;
|
|
74
|
+
static C4R: number;
|
|
75
|
+
static C4G: number;
|
|
76
|
+
static C4B: number;
|
|
77
|
+
static C4A: number;
|
|
78
|
+
static U4: number;
|
|
79
|
+
static V4: number;
|
|
80
|
+
}
|