PencilCode / pencilcode

An online IDE for kids: pencilcode.net.
http://dev.pencilcode.net/
MIT License
167 stars 100 forks source link

p5.js not working? #220

Open bendavis78 opened 8 years ago

bendavis78 commented 8 years ago

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 commented 8 years ago

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)