UNPKG

ngx-spine

Version:

[![Build Status](https://travis-ci.org/PoiScript/ngx-spine.svg?branch=master)](https://travis-ci.org/PoiScript/ngx-spine)

109 lines (108 loc) 5.36 kB
/****************************************************************************** * Spine Runtimes License Agreement * Last updated May 1, 2019. Replaces all prior versions. * * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and * conditions of Section 2 of the Spine Editor License Agreement: * http://esotericsoftware.com/spine-editor-license * * Otherwise, it is permitted to integrate the Spine Runtimes into software * or otherwise create derivative works of the Spine Runtimes (collectively, * "Products"), provided that each user of the Products must obtain their own * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ import { Color, Vector2 } from "./Utils"; import { SkeletonData } from "./SkeletonData"; import { Slot } from "./Slot"; import { Bone } from "./Bone"; import { IkConstraint } from "./IkConstraint"; import { TransformConstraint } from "./TransformConstraint"; import { PathConstraint } from "./PathConstraint"; import { Skin } from "./Skin"; import { Updatable } from "./Updatable"; import { Attachment } from "./attachments/Attachment"; export declare class Skeleton { data: SkeletonData; bones: Array<Bone>; slots: Array<Slot>; drawOrder: Array<Slot>; ikConstraints: Array<IkConstraint>; transformConstraints: Array<TransformConstraint>; pathConstraints: Array<PathConstraint>; _updateCache: Updatable[]; updateCacheReset: Updatable[]; skin: Skin; color: Color; time: number; scaleX: number; scaleY: number; x: number; y: number; constructor(data: SkeletonData); updateCache(): void; sortIkConstraint(constraint: IkConstraint): void; sortPathConstraint(constraint: PathConstraint): void; sortTransformConstraint(constraint: TransformConstraint): void; sortPathConstraintAttachment(skin: Skin, slotIndex: number, slotBone: Bone): void; sortPathConstraintAttachmentWith(attachment: Attachment, slotBone: Bone): void; sortBone(bone: Bone): void; sortReset(bones: Array<Bone>): void; /** Updates the world transform for each bone and applies constraints. */ updateWorldTransform(): void; /** Sets the bones, constraints, and slots to their setup pose values. */ setToSetupPose(): void; /** Sets the bones and constraints to their setup pose values. */ setBonesToSetupPose(): void; setSlotsToSetupPose(): void; /** @return May return null. */ getRootBone(): Bone; /** @return May be null. */ findBone(boneName: string): Bone; /** @return -1 if the bone was not found. */ findBoneIndex(boneName: string): number; /** @return May be null. */ findSlot(slotName: string): Slot; /** @return -1 if the bone was not found. */ findSlotIndex(slotName: string): number; /** Sets a skin by name. * @see #setSkin(Skin) */ setSkinByName(skinName: string): void; /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no * old skin, each slot's setup mode attachment is attached from the new skin. * @param newSkin May be null. */ setSkin(newSkin: Skin): void; /** @return May be null. */ getAttachmentByName(slotName: string, attachmentName: string): Attachment; /** @return May be null. */ getAttachment(slotIndex: number, attachmentName: string): Attachment; /** @param attachmentName May be null. */ setAttachment(slotName: string, attachmentName: string): void; /** @return May be null. */ findIkConstraint(constraintName: string): IkConstraint; /** @return May be null. */ findTransformConstraint(constraintName: string): TransformConstraint; /** @return May be null. */ findPathConstraint(constraintName: string): PathConstraint; /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose. * @param offset The distance from the skeleton origin to the bottom left corner of the AABB. * @param size The width and height of the AABB. * @param temp Working memory */ getBounds(offset: Vector2, size: Vector2, temp?: Array<number>): void; update(delta: number): void; }