Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Bundle
    • Effect

Index

Constructors

Methods

Constructors

constructor

  • new Effect(source: string): Effect
  • new Effect(source: Blob): Effect
  • Creates an effect from {@link Url}

    example
    const octopus = new Effect("effects/octopus.zip")
    

    Parameters

    • source: string

    Returns Effect

  • Creates an effect from Blob

    example
    const file = $("#file-upload").files[0] // File is subclass of Blob
    const octopus = new Effect(file)
    

    Parameters

    • source: Blob

    Returns Effect

Methods

Static preload

  • preload(source: string): Promise<Effect>
  • preload(sources: string[]): Promise<Effect[]>
  • Creates an effect by preloading it from {@link Url}

    example
    const octopus = await Resource.preload("effects/Octopus.zip")
    

    Parameters

    • source: string

    Returns Promise<Effect>

  • Creates an array of effects by preloading them from a list of {@link Url | Urls}

    example
    const [octopus, policeman] = await Effect.preload(["effects/Octopus.zip", "effects/Policeman.zip"])
    

    Parameters

    • sources: string[]

    Returns Promise<Effect[]>