API

Class ParticleHelper

This class is made for on one-liner static method to help creating particle system set.

Index
BaseAssetsUrl: string = ParticleSystemSet.BaseAssetsUrl

Gets or sets base Assets URL

CreateFromSnippetAsync: (
    snippetId: string,
    scene: Scene,
    gpu?: boolean,
    rootUrl?: string,
    capacity?: number,
) => Promise<IParticleSystem> = ParticleHelper.ParseFromSnippetAsync

Creates a particle system from a snippet saved by the particle system editor

Type Declaration

    • (
          snippetId: string,
          scene: Scene,
          gpu?: boolean,
          rootUrl?: string,
          capacity?: number,
      ): Promise<IParticleSystem>
    • Creates a particle system from a snippet saved by the particle system editor

      Parameters

      • snippetId: string

        defines the snippet to load (can be set to _BLANK to create a default one)

      • scene: Scene

        defines the hosting scene

      • gpu: boolean = false

        If the system will use gpu

      • rootUrl: string = ""

        defines the root URL to use to load textures and relative dependencies

      • Optionalcapacity: number

        defines the system capacity (if null or undefined the sotred capacity will be used)

      Returns Promise<IParticleSystem>

      a promise that will resolve to the new particle system

Please use ParseFromSnippetAsync instead

defines the snippet to load (can be set to _BLANK to create a default one)

defines the hosting scene

If the system will use gpu

defines the root URL to use to load textures and relative dependencies

defines the system capacity (if null or undefined the sotred capacity will be used)

a promise that will resolve to the new particle system

SnippetUrl: string = Constants.SnippetUrl

Define the Url to load snippets

  • This is the main static method (one-liner) of this helper to create different particle systems

    Parameters

    • type: string

      This string represents the type to the particle system to create

    • scene: Nullable<Scene>

      The scene where the particle system should live

    • gpu: boolean = false

      If the system will use gpu

    • Optionalcapacity: number

      defines the system capacity (if null or undefined the sotred capacity will be used)

    Returns Promise<ParticleSystemSet>

    the ParticleSystemSet created

  • Creates a particle system from a snippet saved in a remote file

    Parameters

    • name: Nullable<string>

      defines the name of the particle system to create (can be null or empty to use the one from the json data)

    • url: string

      defines the url to load from

    • scene: Scene

      defines the hosting scene

    • gpu: boolean = false

      If the system will use gpu

    • rootUrl: string = ""

      defines the root URL to use to load textures and relative dependencies

    • Optionalcapacity: number

      defines the system capacity (if null or undefined the sotred capacity will be used)

    Returns Promise<IParticleSystem>

    a promise that will resolve to the new particle system

  • Creates a particle system from a snippet saved by the particle system editor

    Parameters

    • snippetId: string

      defines the snippet to load (can be set to _BLANK to create a default one)

    • scene: Scene

      defines the hosting scene

    • gpu: boolean = false

      If the system will use gpu

    • rootUrl: string = ""

      defines the root URL to use to load textures and relative dependencies

    • Optionalcapacity: number

      defines the system capacity (if null or undefined the sotred capacity will be used)

    Returns Promise<IParticleSystem>

    a promise that will resolve to the new particle system