@turbowarp/types
    Preparing search index...

    Interface Sprite

    interface Sprite {
        blocks: VM.Blocks;
        clones: RenderedTarget[];
        costumes: Costume[];
        name: string;
        runtime: Runtime;
        soundBank: SoundBank | null;
        sounds: VM.Sound[];
        addCostumeAt(costumeObject: Costume, index: number): void;
        createClone(optLayerGroup?: string): RenderedTarget;
        deleteCostumeAt(index: number): Costume | undefined;
        dispose(): void;
        duplicate(): Promise<VM.Sprite>;
        removeClone(clone: RenderedTarget): void;
    }
    Index

    Properties

    blocks: VM.Blocks
    clones: RenderedTarget[]
    costumes: Costume[]
    name: string
    runtime: Runtime
    soundBank: SoundBank | null
    sounds: VM.Sound[]

    Methods

    • Add a costume at the given index, taking care to avoid duplicate names.

      Parameters

      • costumeObject: Costume
      • index: number

      Returns void

    • Create a clone of this sprite.

      Parameters

      • OptionaloptLayerGroup: string

        Optional layer group the clone's drawable should be added to. Defaults to the sprite layer group.

      Returns RenderedTarget

    • Delete a costume by index.

      Parameters

      • index: number

      Returns Costume | undefined

      The deleted costume, or undefined if none existed at that index.