Options
Menu

Class Merge

Class Merge merges two or more static sprites into one.Merge

Hierarchy

  • Merge

Index

Constructors

constructor

  • new Merge(keepMaterial?: boolean, disposeSources?: boolean, objectSpace?: boolean): Merge
  • Parameters

    • Default value keepMaterial: boolean = false

      Determines if the merged object uses the recevier sprite material information or keeps its source material(s). Defaults to false. If false and receiver object has multiple materials, the last material found in receiver subsprites is applied to the merged subsprite(es).

    • Default value disposeSources: boolean = false

      Determines if the sprite and geometry source(s) used for the merging are disposed. Defaults to false. If true, only receiver geometry and resulting sprite are kept in memory.

    • Default value objectSpace: boolean = false

      Determines if source sprite(es) is/are merged using objectSpace or worldspace. Defaults to false.

    Returns Merge

Accessors

disposeSources

  • get (): boolean
  • set (b: boolean): void
  • Determines if the sprite and geometry source(s) used for the merging are disposed. Defaults to false.

    Returns boolean

  • Determines if the sprite and geometry source(s) used for the merging are disposed. Defaults to false.

    Parameters

    • b: boolean

    Returns void

keepMaterial

  • get (): boolean
  • set (b: boolean): void
  • Determines if the material source(s) used for the merging are disposed. Defaults to false.

    Returns boolean

  • Determines if the material source(s) used for the merging are disposed. Defaults to false.

    Parameters

    • b: boolean

    Returns void

objectSpace

  • get (): boolean
  • set (b: boolean): void
  • Determines if source sprite(es) is/are merged using objectSpace or worldspace. Defaults to false.

    Returns boolean

  • Determines if source sprite(es) is/are merged using objectSpace or worldspace. Defaults to false.

    Parameters

    • b: boolean

    Returns void

Methods

apply

  • Merges 2 sprites into one. It is recommand to use apply when 2 sprites are to be merged. If more need to be merged, use either applyToSprites or applyToContainer methods.

    Parameters

    • receiver: Sprite

      The Sprite to receive the merged contents of both sprites.

    • sprite: Sprite

      The Sprite to be merged with the receiver sprite

    Returns void

applyToContainer

  • Merges all the children of a container into a single Sprite. If no Sprite object is found, method returns the receiver without modification.

    Parameters

    • receiver: Sprite

      The Sprite to receive the merged contents of the container.

    • objectContainer: DisplayObjectContainer

      The DisplayObjectContainer holding the sprites to be mergd.

    Returns void

    The merged Sprite instance.

applyToSprites

  • applyToSprites(receiver: Sprite, sprites: Array<Sprite>): void
  • Merges all the sprites found in the Array<Sprite> into a single Sprite.

    Parameters

    • receiver: Sprite

      The Sprite to receive the merged contents of the sprites.

    • sprites: Array<Sprite>

      A series of Sprites to be merged with the reciever sprite.

    Returns void

Generated using TypeDoc