Skip to content

Commit

Permalink
Create Settings Page
Browse files Browse the repository at this point in the history
* currently a direct copy of official processing setting page: https://processing.org/reference/settings_.html
* needs to be updated for processing.py
* this was done blind (without building to test) - still need to build and test rendering

Issue jdf#171
  • Loading branch information
FeXd committed Dec 7, 2020
1 parent 3a0b383 commit 0949957
Showing 1 changed file with 113 additions and 0 deletions.
113 changes: 113 additions & 0 deletions Reference/api_en/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>settings()</name>

<category>Environment</category>

<subcategory></subcategory>

<type></type>

<example>
<noimage />
<notest />
<code><![CDATA[
// Run code at full screen using the default renderer
int x = 0;
void settings() {
fullScreen();
}
void setup() {
background(0);
noStroke();
fill(102);
}
void draw() {
rect(x, height*0.2, 1, height*0.6);
x = x + 2;
}
// Run code at full screen using the P2D renderer
// on screen 2 of a multiple monitor hardware setup
int x = 0;
void settings() {
fullScreen(P2D, 2);
}
void setup() {
background(0);
noStroke();
fill(102);
}
void draw() {
rect(x, height*0.2, 1, height*0.6);
x = x + 2;
}
// Run code at full screen using the P2D renderer
// across all screens on a multiple monitor setup
int x = 0;
void settings() {
fullScreen(P2D, SPAN);
}
void setup() {
background(0);
noStroke();
fill(102);
}
void draw() {
rect(x, height*0.2, 1, height*0.6);
x = x + 2;
}
int w = 200;
int h = 200;
int x = 0;
void settings() {
size(w, h);
}
void setup() {
background(0);
noStroke();
fill(102);
}
void draw() {
rect(x, 10, 1, 180);
x = x + 2;
}
]]></code>
</example>

<description><![CDATA[
The settings() function is new with Processing 3.0. It's not needed in most sketches. It's only useful when it's absolutely necessary to define the parameters to size() with a variable. Alternately, the settings() function is necessary when using Processing code outside of the Processing Development Environment (PDE). For example, when using the Eclipse code editor, it's necessary to use settings() to define the size() and smooth() values for a sketch.
<br /> <br />
The settings() method runs before the sketch has been set up, so other Processing functions cannot be used at that point. For instance, do not use loadImage() inside settings(). The settings() method runs "passively" to set a few variables, compared to the setup() command that call commands in the Processing API.
]]></description>

<syntax>
settings()
</syntax>

<returns>void</returns>

<related>fullScreen</related>
<related>setUp</related>
<related>size</related>
<related>smooth</related>

</root>

0 comments on commit 0949957

Please sign in to comment.