-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output canvas to video or sequence of png's #155
Comments
Thank you very much! Do you mind given an example how to use it? I'm new to this package. I tried saving this from the example page:
|
Use this code: from p5 import *
x = 0
y = 0
dim = 80.0
def setup():
size(640, 360)
no_stroke()
def draw():
background(102)
global x
x = x + 0.8
if x > width + dim:
x = -dim
translate(x, height/2 - dim/2)
fill(255)
rect((-dim/2, -dim/2), dim, dim)
# Transforms accumulate. Notice how this rect moves
# twice as fast as the other, but it has the same
# parameter for the x-axis value
translate(x, dim)
fill(0)
rect((-dim/2, -dim/2), dim, dim)
def mouse_pressed():
save_frame("export.png")
if __name__ == '__main__':
run() when the mouse is pressed, the |
Thank you for taking the time to help me out. I really appreicate that. Perfect! |
@ReneTC -- great -- can this be closed, then? |
sorry, yes @jeremydouglass |
Not sure if it's possible, but I can't find anything online or in the documentation:
I think a useful feature would be to output the canvas to either video or a sequence of png's (maybe with alpha channel).
The text was updated successfully, but these errors were encountered: