SpriteComponent: {
    autoPlayClip: string;
    batchGroupId: number;
    clips: {
        [key: string]: {
            autoPlay: boolean;
            fps: number;
            loop: boolean;
            name: string;
            spriteAsset: number;
        };
    };
    color: number[];
    drawOrder: number;
    enabled: boolean;
    flipX: boolean;
    flipY: boolean;
    frame: number;
    height: number;
    layers: number[];
    opacity: number;
    speed: number;
    spriteAsset: number;
    type: string;
    width: number;
}

Sprite Component Properties.

Type declaration

  • autoPlayClip: string

    The name of the sprite animation clip to play automatically when the component is enabled.

    null
    
  • batchGroupId: number

    The batch group id that this sprite belongs to.

    null
    
  • clips: {
        [key: string]: {
            autoPlay: boolean;
            fps: number;
            loop: boolean;
            name: string;
            spriteAsset: number;
        };
    }

    A dictionary containing data for all sprite animation clips. Each key is the index of the clip.

  • color: number[]

    The color tint of the sprite, represented as an array of 3 numbers.

    [1,1,1]
    
  • drawOrder: number

    The draw order of the sprite; higher values are rendered on top of others.

    0
    
  • enabled: boolean

    Whether the component is enabled.

    true
    
  • flipX: boolean

    If true, flips the sprite on the X axis.

    false
    
  • flipY: boolean

    If true, flips the sprite on the Y axis.

    false
    
  • frame: number

    The frame of the sprite asset to render.

    0
    
  • height: number

    The height of the sprite for 9-slicing rendering.

    1
    
  • layers: number[]

    The layers this sprite belongs to.

    [0]
    
  • opacity: number

    The opacity of the sprite.

    1
    
  • speed: number

    Global speed modifier for sprite animation clips.

    1
    
  • spriteAsset: number

    The id of the sprite asset used by the component.

    null
    
  • type: string

    The type of sprite component. Can be pc.SPRITETYPE_SIMPLE or pc.SPRITETYPE_ANIMATED.

    "simple"
    
  • width: number

    The width of the sprite for 9-slicing rendering.

    1