createGraphics() undefined #1237

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

Comments

Projects
None yet
3 participants
@ghost

ghost commented Feb 5, 2016

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

@limzykenneth

This comment has been minimized.

Show comment
Hide comment
@limzykenneth

limzykenneth Feb 10, 2016

Contributor

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.

Contributor

limzykenneth commented Feb 10, 2016

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

This comment has been minimized.

Show comment
Hide comment
@toolness

toolness Feb 11, 2016

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!

Member

toolness commented Feb 11, 2016

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

This comment has been minimized.

Show comment
Hide comment
@lmccart

lmccart Feb 12, 2016

Member

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

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