@batpb/genart - v2.0.0-rc.3-alpha.2
    Preparing search index...

    Class P5Context

    P5Context provides static access to the p5.js context. This context allows access to all methods and variables of the p5.js library.

    2.0.0

    Index

    Constructors

    Accessors

    Methods

    Constructors

    • Returns P5Context

      • P5Context is a static class and cannot be instantiated.

      2.0.0

    Accessors

    • get instance(): __module

      Returns __module

      The p5.js context instance. If no context has been initialized, a default context will be created.

      2.0.0

    Methods

    • Does P5Context have an initialized p5.js context?

      Returns boolean

      True if P5Context has an initialized p5.js context, false otherwise.

      2.0.0

    • Set the p5.js context. This will reset the current context with P5Context.reset.

      Parameters

      • p5Instance: __module

        The p5.js context instance to use.

      • replace: boolean = false

        If true, the current context will be replaced. If false, the given p5Instance will only be used if no context has been initialized. This parameter defaults to false.

      Returns boolean

      True if the given p5Instance was successfully applied, false otherwise.

      2.0.0

    • Resets the p5.js context.

      Returns void

      This removes the p5.js context. This may cause unexpected behavior. You will lose access to the current context and the current canvas.

      2.0.0