Created
March 22, 2020 05:16
-
-
Save geecu/730f7ecd67b376c92a84d4752eff4864 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const sketch = function(p) { | |
p.setup = function() { | |
p.colorMode(p.HSB, 1); | |
p.createCanvas(p.windowWidth, 100); | |
}; | |
p.draw = function() { | |
p.background(1, 1, 1); | |
p.fill(1); | |
p.rect(p.mouseX, p.mouseY, 50, 50); | |
}; | |
}; | |
require([ | |
'https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.0.0/p5.min.js', | |
], function(p5) { | |
define('p5', [], function() { | |
return p5; | |
}); | |
require([ | |
'p5', | |
'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/addons/p5.dom.js', | |
'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/addons/p5.sound.js', | |
], function(p5) { | |
const p5instance = new p5(sketch); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment