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

createGraphics() undefined #1237

Closed
ghost opened this issue Feb 5, 2016 · 3 comments
Closed

createGraphics() undefined #1237

ghost opened this issue Feb 5, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 5, 2016

createGraphics() will be undefined unless used in setup() making it unusable in objects and other things

@limzykenneth
Copy link
Member

As I remember, createGraphics() should work in other p5 methods such as draw() and mousePressed() as well. The problem you have might be you are trying to access p5 methods before p5 is initialized (in setup() usually). You can try ensuring the p5 object is initialized either with instance mode or by making sure setup is called before making other calls to createGraphics() in other objects etc. You can look at #903 about this. And this.

Let me know if that's not the case.

@toolness
Copy link
Member

Hmm, it sounds like we should add createGraphics and, given #903, all of P5's constants to the list of symbols we provide error help for in #1130... And we should probably add a link in the friendly error message to the FAQ question that @limzykenneth just linked to!

@lmccart
Copy link
Member

lmccart commented Feb 12, 2016

great. it sounds like the issue here is now covered in #1247, so i'm going to close this one.

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