Created
November 21, 2022 19:15
-
-
Save BenjaminSantiago/2e9c405dcfa336886d413c83bd3887f8 to your computer and use it in GitHub Desktop.
Our little drawing example but with the ability to save. Check your project folder to find the actual files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drawing = False | |
def setup(): | |
size(500,500) | |
background(240) | |
stroke(220,0, 220) | |
strokeWeight(20) | |
def draw(): | |
global drawing | |
if drawing is True: | |
line(pmouseX, pmouseY, mouseX, mouseY) | |
def mousePressed(): | |
global drawing | |
if drawing is False: | |
drawing = True | |
def mouseReleased(): | |
global drawing | |
if drawing is True: | |
drawing = False | |
def keyReleased(): | |
if key == 'e': | |
background(240) | |
if key == 's': | |
saveFrame('screen__#####.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment