adding p5.js

Hi! I’m trying to add p5.js to my code but can’t seem to figure it out. Nothing ends up showing up on the page. Wondering if anyone can help!

I’m adding this to the section:

<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/p5.js"></script>

and this code from the p5.js get started page to “before ”:

<script>

function setup() {createCanvas(400, 400);}function draw() {background(220);ellipse(50,50,80,80);}

</script>

Hi @Lea_Naisberg, looks like the code is all good and works in my editor. I presume it’s because this will likely show up in the body of the project so it’s technically set to the back of the z-index. I suggest adding the following code to a code embed element and turning on iframe to have it show.

hi @HEADLESS.HORSE ! hm, i don’t seem to see the code you mention. I updated my widget code to this and selected iframe:

* {z-index:100000;}

still doesn’t work for me :frowning:


here’s a pic. for some reason i think some text isn’t showing up on the forum

Hi @Lea_Naisberg I have just copied your code into a code element and it works for me, I suggest making a new project and trying it on a blank project and seeing if that works?

<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/p5.js"></script>

and this code from the p5.js get started page to "before ":

<script>

function setup() {createCanvas(400, 400);}function draw() {background(220);ellipse(50,50,80,80);}

</script>