UNPKG

@esotericsoftware/spine-core

Version:
111 lines (110 loc) 4.76 kB
/****************************************************************************** * Spine Runtimes License Agreement * Last updated April 5, 2025. Replaces all prior versions. * * Copyright (c) 2013-2025, 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. * * THE SPINE RUNTIMES ARE 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 * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ import { TextureRegion } from "../Texture.js"; import { Color, NumberArrayLike } from "../Utils.js"; import { Attachment } from "./Attachment.js"; import { HasTextureRegion } from "./HasTextureRegion.js"; import { Sequence } from "./Sequence.js"; import { Slot } from "../Slot.js"; /** An attachment that displays a textured quadrilateral. * * See [Region attachments](http://esotericsoftware.com/spine-regions) in the Spine User Guide. */ export declare class RegionAttachment extends Attachment implements HasTextureRegion { /** The local x translation. */ x: number; /** The local y translation. */ y: number; /** The local scaleX. */ scaleX: number; /** The local scaleY. */ scaleY: number; /** The local rotation. */ rotation: number; /** The width of the region attachment in Spine. */ width: number; /** The height of the region attachment in Spine. */ height: number; /** The color to tint the region attachment. */ color: Color; /** The name of the texture region for this attachment. */ path: string; region: TextureRegion | null; sequence: Sequence | null; /** For each of the 4 vertices, a pair of <code>x,y</code> values that is the local position of the vertex. * * See {@link #updateOffset()}. */ offset: NumberArrayLike; uvs: NumberArrayLike; tempColor: Color; constructor(name: string, path: string); /** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */ updateRegion(): void; /** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may * be changed. * <p> * See <a href="http://esotericsoftware.com/spine-runtime-skeletons#World-transforms">World transforms</a> in the Spine * Runtimes Guide. * @param worldVertices The output world vertices. Must have a length >= <code>offset</code> + 8. * @param offset The <code>worldVertices</code> index to begin writing values. * @param stride The number of <code>worldVertices</code> entries between the value pairs written. */ computeWorldVertices(slot: Slot, worldVertices: NumberArrayLike, offset: number, stride: number): void; copy(): Attachment; static X1: number; static Y1: number; static C1R: number; static C1G: number; static C1B: number; static C1A: number; static U1: number; static V1: number; static X2: number; static Y2: number; static C2R: number; static C2G: number; static C2B: number; static C2A: number; static U2: number; static V2: number; static X3: number; static Y3: number; static C3R: number; static C3G: number; static C3B: number; static C3A: number; static U3: number; static V3: number; static X4: number; static Y4: number; static C4R: number; static C4G: number; static C4B: number; static C4A: number; static U4: number; static V4: number; }