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

Docs: Ambiguity on where to call smooth() #4211

Closed
mikechambers opened this Issue Dec 19, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@mikechambers

mikechambers commented Dec 19, 2015

Using FX2D renderer, compiling outside of processing editor, if you put a call to smooth inside of setup(), you get the following error:

smooth() can only be used inside settings()

However, the change page at:

https://github.com/processing/processing/wiki/Changes-in-3.0

Says:

smooth() and noSmooth() can only be used in setup()

Not sure which one is correct, but whichever is not, it should be updated.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Dec 28, 2015

Contributor

Put it into setup() when running from the Processing editor, into settings() when running outside of the Processing editor. The editor looks what's in setup() and creates settings() method automagically, if you code without the editor it's your responsibility. Doesn't matter which renderer you use.

Instructions for people coding without the Processing editor are in the NEW section of the changes page, so I believe it's covered enough:

A new settings() method that is called behind the scenes. Most users will never notice this, but if you're using Processing without its preprocessor (i.e. from Eclipse or a similar development environment), then put any calls to size(), fullScreen(), smooth(), noSmooth(), and pixelDensity() into that method. More information can be found in the reference. Only users who are in other development environments should use settings(). It shouldn't be used for any other purpose.

Contributor

JakubValtar commented Dec 28, 2015

Put it into setup() when running from the Processing editor, into settings() when running outside of the Processing editor. The editor looks what's in setup() and creates settings() method automagically, if you code without the editor it's your responsibility. Doesn't matter which renderer you use.

Instructions for people coding without the Processing editor are in the NEW section of the changes page, so I believe it's covered enough:

A new settings() method that is called behind the scenes. Most users will never notice this, but if you're using Processing without its preprocessor (i.e. from Eclipse or a similar development environment), then put any calls to size(), fullScreen(), smooth(), noSmooth(), and pixelDensity() into that method. More information can be found in the reference. Only users who are in other development environments should use settings(). It shouldn't be used for any other purpose.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Feb 13, 2016

Member

The error message says settings() because it sees that you're not running from the PDE. I've added another line to that warning for clarification: "When run from the PDE, %s() is automatically moved from setup() to settings()"

Member

benfry commented Feb 13, 2016

The error message says settings() because it sees that you're not running from the PDE. I've added another line to that warning for clarification: "When run from the PDE, %s() is automatically moved from setup() to settings()"

@benfry benfry removed the invalid label Feb 13, 2016

benfry added a commit that referenced this issue Feb 13, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment