@bscotch/stitch
Version:
Stitch: The GameMaker Studio 2 Asset Pipeline Development Kit.
43 lines • 2.2 kB
TypeScript
import { Pathy } from '@bscotch/pathy';
import { SpritelySubimage } from '@bscotch/spritely';
import { SpriteType, YySprite } from '@bscotch/yy';
import { Spine } from '../../../types/Spine.js';
import type { StitchProjectComms } from '../../StitchProject.js';
import { Gms2ResourceBase, Gms2ResourceBaseParameters } from './Gms2ResourceBase.js';
import { SpriteSyncResult } from './Gms2Sprite.update.js';
export declare class Gms2Sprite extends Gms2ResourceBase<YySprite> {
constructor(...setup: Gms2ResourceBaseParameters);
get isSpine(): boolean;
get textureGroup(): string;
set textureGroup(name: string);
/** Get the array of current frameIds, in their frame order. */
get frameIds(): string[];
get spriteType(): SpriteType;
set spriteType(type: SpriteType);
/** Force a layerId. Only updates the YY file, and only if there is only 1 layer. */
setLayerId(layerId: string): this;
/**
* Update a sprite frame from a source image. If the frame
* already has an identical image, this will return `undefined`.
*/
updateFrameImage(imagePath: string, frameGuid: string): Promise<SpritelySubimage | undefined>;
/**
* Force the frames of this sprite to match the images
* within a folder (non-recursive)
*/
syncWithSource(spriteDirectoryOrSpineJson: string, isNew: boolean): Promise<SpriteSyncResult>;
/**
* Create a new sprite
* @param subimageDirectory Absolute path to a directory containing the
* subimages for this sprite. Will non-recursively
* search for png images within that directory
* and sort them alphabetically.
*/
static create(subimageDirectory: string, comms: StitchProjectComms, spriteName?: string,
/** Mutated based on outcomes of the sync step. */
results?: Partial<SpriteSyncResult>): Promise<Gms2Sprite>;
static createFromSpine(spineJsonFile: Pathy<Spine>, comms: StitchProjectComms, spriteName?: string,
/** Mutated based on outcomes of the sync step. */
results?: Partial<SpriteSyncResult>): Promise<Gms2Sprite>;
}
//# sourceMappingURL=Gms2Sprite.d.ts.map