-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
Description
The PRs #137 and #135 (thanks @villares <3) introduced support to a PVector class to be closer to Processing's API. But a PVector can't be initialized outside setup or draw yet. Probably we'll have to introduce some lazy loading in the __init__ to enable this.
Here's a sample code to reproduce the bug:
v = PVector(50, 50)
def setup():
size(400, 400)
background(160)
def draw():
translate(50, 200)
fill("blue")
background(200)
radius = sin(frameCount / 60) * 50 + 50
ellipse(v.x, v.y, radius, radius)
Transcypt traceback
Uncaught TypeError: _P5_INSTANCE is null
PVector pyp5js.py:978
<anonymous> vec.py:3