Skip to content
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

p5.js not working? #220

Open
bendavis78 opened this issue Feb 21, 2016 · 1 comment
Open

p5.js not working? #220

bendavis78 opened this issue Feb 21, 2016 · 1 comment

Comments

@bendavis78
Copy link

Seems like this should work: http://robotben.pencilcode.net/edit/p5test

background(255, 0, 0)

I get the error "background is not defined".

http://p5js.org/reference/#/p5/background

@bendavis78
Copy link
Author

Actully, looks like you have to put it inside a draw() function, and it also needs to be defined on the window global (since coffeescript wraps everything in a closure).

window.draw = ->
  background(255, 0, 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant