p5exClass

p5ex~ p5exClass

Extension of p5 class.

Constructor

new p5exClass(sketch, node, sync)

Constructor of class p5ex.
Source:
Parameters:
Name Type Description
sketch
node
sync

Members

idealFrameRate

The ideal frame rate which was set by setFrameRate().
Source:

nonScaledHeight

The non-scaled height of the canvas.
Source:

nonScaledWidth

The non-scaled width of the canvas.
Source:

unitAccelerationMagnitude

Change of speed per frame which corresponds to 1 unit speed per second. Set by setFrameRate().
Source:

unitAngleSpeed

Anglular displacement in radians per frame which corresponds to 1 cycle per second. Set by setFrameRate().
Source:

unitSpeed

Positional displacement per frame which corresponds to 1 unit length per second. Set by setFrameRate().
Source:

Methods

createScalableCanvas(type, parametersopt, rendererTypeopt)

Create an instance of ScalableCanvas. This includes calling of createCanvas().
Source:
Parameters:
Name Type Attributes Description
type ScalableCanvasType Type chosen from p5ex.ScalableCanvasTypes.
parameters ScalableCanvasParameters <optional>
Parameters for type CUSTOM.
rendererType string <optional>
Either P2D or WEBGL.

resizeScalableCanvas(typeopt, parametersopt)

Resizes the ScalableCanvas. Does not work on OpenProcessing.
Source:
Parameters:
Name Type Attributes Description
type ScalableCanvasType <optional>
Type chosen from p5ex.ScalableCanvasTypes. If undefined, the last used type will be used again.
parameters ScalableCanvasParameters <optional>
Parameters for type CUSTOM.

setCurrentRenderer(renderer)

Sets the current renderer object.
Source:
Parameters:
Name Type Description
renderer

setFrameRate(fpsopt)

Calls frameRate() and sets variables related to the frame rate.
Source:
Parameters:
Name Type Attributes Default Description
fps number <optional>
60 The ideal frame rate per second.

updateMaxCanvasRegion()

Updates the value of the variable maxCanvasRegion.
Source: