OpenFairyGUI API
    Preparing search index...

    Interface AtlasOptions

    interface AtlasOptions {
        allowRotation?: boolean;
        basePath?: string;
        directSingleImageOutput?: boolean;
        encoder?: AtlasRasterBackend;
        extractAlpha?: boolean;
        fast?: boolean;
        maxSize?: number;
        mkdir?: (path: string) => Promise<void>;
        multiPage?: boolean;
        outputPath?: string;
        packages?: string[];
        padding?: number;
        powerOfTwo?: boolean;
        preserveInputOrderOnTie?: boolean;
        readFileRaw?: (path: string) => Promise<Uint8Array<ArrayBufferLike>>;
        separatedAtlasForBranch?: boolean;
        square?: boolean;
        trimImage?: boolean;
    }
    Index
    allowRotation?: boolean

    Allow rotating sprites 90° for better packing. Default: true.

    basePath?: string

    Base path for reading source images. If not set, images must have their pixel data stored in extras._imageData as Uint8Array.

    directSingleImageOutput?: boolean

    Internal publish detail used by Unity binary output: allow single untrimmed PNG image packages to bypass the packer and write atlas0 directly, matching the reference CLI behavior.

    Raster backend, injected by the host adapter. Required for actual image compositing and trimImage.

    import sharp from 'sharp';
    await doc.transform(atlas({ encoder: sharp }));
    extractAlpha?: boolean

    Internal publish detail used by the direct-image-output path. When extractAlpha is enabled, the direct output shortcut must be disabled.

    fast?: boolean

    Whether to use the fast editor-compatible packing heuristics. Default: true.

    maxSize?: number

    Maximum atlas texture size (width and height). Default: 2048.

    mkdir?: (path: string) => Promise<void>

    Optional mkdir function to ensure output directory exists. If not provided, the outputPath directory must already exist.

    multiPage?: boolean

    Allow spilling into multiple atlas pages. Default: true.

    outputPath?: string

    Output directory for generated atlas PNGs. Required when encoder is provided.

    packages?: string[]

    Limit atlas generation to specific package names. When omitted, all packages are processed.

    padding?: number

    Pixel padding between sprites. Default: 1.

    powerOfTwo?: boolean

    Constrain atlas dimensions to powers of two. Default: false.

    preserveInputOrderOnTie?: boolean

    Keep original input order when MaxRects tie-break scores are equal. This is an internal publish detail used to mirror editor/CLI behavior.

    readFileRaw?: (path: string) => Promise<Uint8Array<ArrayBufferLike>>

    Optional raw file reader for reading .jta MovieClip files. Required for MovieClip frame atlas packing.

    separatedAtlasForBranch?: boolean

    When branchProcessing keeps branch resources, publish branch images into separate atlas pages/files per branch instead of mixing them with main.

    square?: boolean

    Force square atlas (width === height). Default: false.

    trimImage?: boolean

    Trim transparent pixels from image edges before packing. Requires a raster backend. Stores offset/originalSize in Sprite nodes. Default: false.