interface IShapeDrawer<TParticle> {
    afterDraw?: ((data: IShapeDrawData<TParticle>) => void);
    destroy?: ((container: Container) => void);
    draw: ((data: IShapeDrawData<TParticle>) => void);
    getSidesCount?: ((particle: TParticle) => number);
    init?: ((container: Container) => Promise<void>);
    loadShape?: ((particle: TParticle) => void);
    particleDestroy?: ((particle: TParticle) => void);
    particleInit?: ((container: Container, particle: TParticle) => void);
    validTypes: readonly string[];
}

Type Parameters

Properties

afterDraw?: ((data: IShapeDrawData<TParticle>) => void)

Shape after draw effect function

Type declaration

destroy?: ((container: Container) => void)

Shape destroy function

Type declaration

    • (container): void
    • Parameters

      • container: Container

        the container initializing the shape

      Returns void

draw: ((data: IShapeDrawData<TParticle>) => void)

Shape draw function

Type declaration

getSidesCount?: ((particle: TParticle) => number)

Shape sides count function

Type declaration

    • (particle): number
    • Parameters

      • particle: TParticle

        the particle using the shape

      Returns number

      the number of sides for the used shape

init?: ((container: Container) => Promise<void>)

Shape init function

Type declaration

    • (container): Promise<void>
    • Parameters

      • container: Container

        the container initializing the shape

      Returns Promise<void>

loadShape?: ((particle: TParticle) => void)

Shape load function

Type declaration

    • (particle): void
    • Parameters

      • particle: TParticle

        the particle using the shape

      Returns void

particleDestroy?: ((particle: TParticle) => void)

Shape particle destroy function

Type declaration

    • (particle): void
    • Parameters

      • particle: TParticle

        the particle being destroyed

      Returns void

particleInit?: ((container: Container, particle: TParticle) => void)

Shape particle init function

Type declaration

    • (container, particle): void
    • Parameters

      • container: Container

        the container containing the shape

      • particle: TParticle

        the particle using the shape

      Returns void

validTypes: readonly string[]