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

Does p5play impact the p5 DOM functions? #281

Closed
zoebachman opened this issue Dec 13, 2023 · 2 comments
Closed

Does p5play impact the p5 DOM functions? #281

zoebachman opened this issue Dec 13, 2023 · 2 comments

Comments

@zoebachman
Copy link

zoebachman commented Dec 13, 2023

Hello - not sure if this is an issue with the p5.js web editor or something changed in this library, but one of my student's p5play projects suddenly stopped working today and it seems like the error is introduced once we link the p5play library. She built it in the p5 web editor (here's my copy of her code).

She's trying to position her canvas within a larger webpage, but when she calls .position on her canvas element, she now gets an error saying that .position is not a recognized function (here it is in the p5 documentation). I was stumped because all of this code was working fine for the past several days until today when she went to present it in class. I tried the .position sample code in a new project and it works fine - until I include the p5play libraries. I know that in the past you have to separately include the p5 DOM library, but my understanding is that it's no longer the case? I tried it in OpenProcessing and running into the same error. Thanks!

@GoToLoop
Copy link

GoToLoop commented Dec 13, 2023

Indeed, if p5.play is loaded, createCanvas() returns the <canvas> element itself!
However, it should return a p5.Renderer object instead.

@quinton-ashley quinton-ashley changed the title Does p5.play impact the p5 DOM functions? Does p5play impact the p5 DOM functions? Dec 13, 2023
@quinton-ashley
Copy link
Owner

Ah yes my mistake. Thanks for reporting! Fixed in v3.18.8

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

3 participants