Incorporating P5 into a Vue application can be achieved using the following code snippet:
let script = p5 => {
p5.setup = _ => {
this.setup(p5)
}
p5.draw = _ => {
this.draw(p5)
}
}
this.ps = new P5(script)
While functions like background(0)
(p5.background(0)
) work perfectly, there seems to be an issue when attempting to use p5.Vector.fromAngle(angle)
. The error message received is:
TypeError: Cannot read property 'fromAngle' of undefined
It is believed that this method is static in nature. Any guidance on how to access it would be greatly appreciated.