picrate 2.0.0.pre-java → 2.0.1-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +7 -8
- data/Rakefile +9 -8
- data/docs/_config.yml +1 -1
- data/docs/_editors/geany.md +1 -0
- data/docs/_gems/gems/gems.md +1 -1
- data/docs/_posts/2018-05-06-getting_started.md +4 -4
- data/docs/_posts/2018-05-06-install_jruby.md +3 -9
- data/docs/_posts/2018-05-11-arch-linux-arm.md +1 -11
- data/docs/_posts/2018-11-18-building-gem.md +2 -2
- data/docs/_posts/2018-11-27-getting_started_geany.md +1 -1
- data/docs/_posts/2019-11-11-getting_started_buster.md +4 -7
- data/docs/_posts/2020-03-09-auto_install_picrate.md +34 -0
- data/docs/_posts/2020-05-11-getting_started_manjaro.md +94 -0
- data/docs/about.md +1 -1
- data/lib/picrate/app.rb +1 -0
- data/lib/picrate/native_folder.rb +6 -7
- data/lib/picrate/version.rb +1 -1
- data/picrate.gemspec +3 -5
- data/pom.rb +19 -17
- data/pom.xml +17 -5
- data/src/main/java/processing/core/PApplet.java +198 -198
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +2138 -2324
- data/src/main/java/processing/opengl/PShapeOpenGL.java +5 -6
- metadata +10 -45
- data/docs/_posts/2018-06-26-auto_install_picrate.md +0 -30
- data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +0 -160
- data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +0 -160
data/pom.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
project 'picrate', 'http://maven.apache.org' do
|
4
4
|
model_version '4.0.0'
|
5
|
-
id 'ruby-processing:picrate:2.0.
|
5
|
+
id 'ruby-processing:picrate:2.0.1'
|
6
6
|
packaging 'jar'
|
7
7
|
|
8
8
|
description 'An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.'
|
@@ -22,7 +22,7 @@ project 'picrate', 'http://maven.apache.org' do
|
|
22
22
|
license 'LGPL 2', 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html'
|
23
23
|
|
24
24
|
issue_management 'https://github.com/ruby-processing/PiCrate/issues', 'Github'
|
25
|
-
|
25
|
+
# Need to update to jogl 2.4.1 as soon as available, then make a dependency
|
26
26
|
properties('jogl.version' => '2.3.2',
|
27
27
|
'jruby.api' => 'http://jruby.org/apidocs/',
|
28
28
|
'source.directory' => 'src',
|
@@ -38,21 +38,23 @@ project 'picrate', 'http://maven.apache.org' do
|
|
38
38
|
end
|
39
39
|
|
40
40
|
overrides do
|
41
|
-
plugin :resources, '
|
42
|
-
plugin :dependency, '2
|
43
|
-
plugin(:compiler, '3.8.1',
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
41
|
+
plugin :resources, '3.1.0'
|
42
|
+
plugin :dependency, '3.1.2'
|
43
|
+
plugin(:compiler, '3.8.1',
|
44
|
+
'release' => '11')
|
45
|
+
plugin(:javadoc, '2.10.4',
|
46
|
+
'detectOfflineLinks' => 'false',
|
47
|
+
'links' => ['${processing.api}',
|
48
|
+
'${jruby.api}'])
|
49
|
+
plugin(:jar, '3.2.0',
|
50
|
+
'archive' => {
|
51
|
+
'manifestEntries' => {
|
52
|
+
'Class-Path' => 'gluegen-rt.jar jog-all.jar'
|
53
|
+
}
|
54
|
+
})
|
55
|
+
plugin :jdeps, '3.1.2' do
|
56
|
+
execute_goals 'jdkinternals', 'test-jdkinternals'
|
57
|
+
end
|
56
58
|
end
|
57
59
|
|
58
60
|
build do
|
data/pom.xml
CHANGED
@@ -11,7 +11,7 @@ DO NOT MODIFIY - GENERATED CODE
|
|
11
11
|
<modelVersion>4.0.0</modelVersion>
|
12
12
|
<groupId>ruby-processing</groupId>
|
13
13
|
<artifactId>picrate</artifactId>
|
14
|
-
<version>2.0.
|
14
|
+
<version>2.0.1</version>
|
15
15
|
<name>picrate</name>
|
16
16
|
<description>An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.</description>
|
17
17
|
<url>http://maven.apache.org</url>
|
@@ -119,11 +119,11 @@ DO NOT MODIFIY - GENERATED CODE
|
|
119
119
|
<plugins>
|
120
120
|
<plugin>
|
121
121
|
<artifactId>maven-resources-plugin</artifactId>
|
122
|
-
<version>
|
122
|
+
<version>3.1.0</version>
|
123
123
|
</plugin>
|
124
124
|
<plugin>
|
125
125
|
<artifactId>maven-dependency-plugin</artifactId>
|
126
|
-
<version>2
|
126
|
+
<version>3.1.2</version>
|
127
127
|
</plugin>
|
128
128
|
<plugin>
|
129
129
|
<artifactId>maven-compiler-plugin</artifactId>
|
@@ -134,7 +134,7 @@ DO NOT MODIFIY - GENERATED CODE
|
|
134
134
|
</plugin>
|
135
135
|
<plugin>
|
136
136
|
<artifactId>maven-javadoc-plugin</artifactId>
|
137
|
-
<version>
|
137
|
+
<version>2.10.4</version>
|
138
138
|
<configuration>
|
139
139
|
<detectOfflineLinks>false</detectOfflineLinks>
|
140
140
|
<links>
|
@@ -145,7 +145,7 @@ DO NOT MODIFIY - GENERATED CODE
|
|
145
145
|
</plugin>
|
146
146
|
<plugin>
|
147
147
|
<artifactId>maven-jar-plugin</artifactId>
|
148
|
-
<version>3.
|
148
|
+
<version>3.2.0</version>
|
149
149
|
<configuration>
|
150
150
|
<archive>
|
151
151
|
<manifestEntries>
|
@@ -154,6 +154,18 @@ DO NOT MODIFIY - GENERATED CODE
|
|
154
154
|
</archive>
|
155
155
|
</configuration>
|
156
156
|
</plugin>
|
157
|
+
<plugin>
|
158
|
+
<artifactId>maven-jdeps-plugin</artifactId>
|
159
|
+
<version>3.1.2</version>
|
160
|
+
<executions>
|
161
|
+
<execution>
|
162
|
+
<goals>
|
163
|
+
<goal>jdkinternals</goal>
|
164
|
+
<goal>test-jdkinternals</goal>
|
165
|
+
</goals>
|
166
|
+
</execution>
|
167
|
+
</executions>
|
168
|
+
</plugin>
|
157
169
|
</plugins>
|
158
170
|
</pluginManagement>
|
159
171
|
</build>
|
@@ -83,35 +83,35 @@ import processing.opengl.*;
|
|
83
83
|
|
84
84
|
/**
|
85
85
|
* Base class for all sketches that use processing.core.
|
86
|
-
*
|
86
|
+
*
|
87
87
|
* The
|
88
88
|
* <A HREF="https://github.com/processing/processing/wiki/Window-Size-and-Full-Screen">
|
89
89
|
* Window Size and Full Screen</A> page on the Wiki has useful information about
|
90
90
|
* sizing, multiple displays, full screen, etc.
|
91
|
-
*
|
91
|
+
*
|
92
92
|
* Processing uses active mode rendering. All animation tasks happen on the
|
93
93
|
* "Processing Animation Thread". The setup() and draw() methods are handled by
|
94
94
|
* that thread, and events (like mouse movement and key presses, which are fired
|
95
95
|
* by the event dispatch thread or EDT) are queued to be safely handled at the
|
96
96
|
* end of draw().
|
97
|
-
*
|
97
|
+
*
|
98
98
|
* Starting with 3.0a6, blit operations are on the EDT, so as not to cause GUI
|
99
99
|
* problems with Swing and AWT. In the case of the default renderer, the sketch
|
100
100
|
* renders to an offscreen image, then the EDT is asked to bring that image to
|
101
101
|
* the screen.
|
102
|
-
*
|
102
|
+
*
|
103
103
|
* For code that needs to run on the EDT, use EventQueue.invokeLater(). When
|
104
104
|
* doing so, be careful to synchronize between that code and the Processing
|
105
105
|
* animation thread. That is, you can't call Processing methods from the EDT or
|
106
106
|
* at any random time from another thread. Use of a callback function or the
|
107
107
|
* registerXxx() methods in PApplet can help ensure that your code doesn't do
|
108
108
|
* something naughty.
|
109
|
-
*
|
109
|
+
*
|
110
110
|
* As of Processing 3.0, we have removed Applet as the base class for PApplet.
|
111
111
|
* This means that we can remove lots of legacy code, however one downside is
|
112
112
|
* that it's no longer possible (without extra code) to embed a PApplet into
|
113
113
|
* another Java application.
|
114
|
-
*
|
114
|
+
*
|
115
115
|
* As of Processing 3.0, we have discontinued support for versions of Java prior
|
116
116
|
* to 1.8. We don't have enough people to support it, and for a project of our
|
117
117
|
* (tiny) size, we should be focusing on the future, rather than working around
|
@@ -182,7 +182,7 @@ public class PApplet implements PConstants {
|
|
182
182
|
* if the current screen resolution is 1024x768,
|
183
183
|
* <b>displayWidth</b> is 1024 and <b>displayHeight</b> is 768. These
|
184
184
|
* dimensions are useful when exporting full-screen applications.
|
185
|
-
*
|
185
|
+
*
|
186
186
|
* To ensure that the sketch takes over the entire screen, use "Present"
|
187
187
|
* instead of "Run". Otherwise the window will still have a frame border
|
188
188
|
* around it and not be placed in the upper corner of the screen. On Mac OS X,
|
@@ -199,7 +199,7 @@ public class PApplet implements PConstants {
|
|
199
199
|
* if the current screen resolution is 1024x768,
|
200
200
|
* <b>displayWidth</b> is 1024 and <b>displayHeight</b> is 768. These
|
201
201
|
* dimensions are useful when exporting full-screen applications.
|
202
|
-
*
|
202
|
+
*
|
203
203
|
* To ensure that the sketch takes over the entire screen, use "Present"
|
204
204
|
* instead of "Run". Otherwise the window will still have a frame border
|
205
205
|
* around it and not be placed in the upper corner of the screen. On Mac OS X,
|
@@ -264,7 +264,7 @@ public class PApplet implements PConstants {
|
|
264
264
|
* <b>index</b> value defines the position of a value within the array. For
|
265
265
|
* example, the statement <b>color b = pixels[230]</b> will set the variable
|
266
266
|
* <b>b</b> to be equal to the value at that location in the array.
|
267
|
-
*
|
267
|
+
*
|
268
268
|
* Before accessing this array, the data must loaded with the
|
269
269
|
* <b>loadPixels()</b> function. After the array data has been modified, the
|
270
270
|
* <b>updatePixels()</b> function must be run to update the changes. Without
|
@@ -421,7 +421,7 @@ public class PApplet implements PConstants {
|
|
421
421
|
*
|
422
422
|
* The system variable <b>pmouseX</b> always contains the horizontal position
|
423
423
|
* of the mouse in the frame previous to the current frame.
|
424
|
-
*
|
424
|
+
*
|
425
425
|
* You may find that <b>pmouseX</b> and <b>pmouseY</b> have different values
|
426
426
|
* inside <b>draw()</b> and inside events like <b>mousePressed()</b>
|
427
427
|
* and <b>mouseMoved()</b>. This is because they're used for different roles,
|
@@ -575,7 +575,7 @@ public class PApplet implements PConstants {
|
|
575
575
|
*
|
576
576
|
* The system variable <b>key</b> always contains the value of the most recent
|
577
577
|
* key on the keyboard that was used (either pressed or released).
|
578
|
-
*
|
578
|
+
*
|
579
579
|
* For non-ASCII keys, use the <b>keyCode</b> variable. The keys included in
|
580
580
|
* the ASCII specification (BACKSPACE, TAB, ENTER, RETURN, ESC, and DELETE) do
|
581
581
|
* not require checking to see if they key is coded, and you should simply use
|
@@ -608,7 +608,7 @@ public class PApplet implements PConstants {
|
|
608
608
|
* DOWN, LEFT, RIGHT arrow keys and ALT, CONTROL, SHIFT. When checking for
|
609
609
|
* these keys, it's first necessary to check and see if the key is coded. This
|
610
610
|
* is done with the conditional "if (key == CODED)" as shown in the example.
|
611
|
-
*
|
611
|
+
*
|
612
612
|
* The keys included in the ASCII specification (BACKSPACE, TAB, ENTER,
|
613
613
|
* RETURN, ESC, and DELETE) do not require checking to see if they key is
|
614
614
|
* coded, and you should simply use the <b>key</b> variable instead of
|
@@ -616,7 +616,7 @@ public class PApplet implements PConstants {
|
|
616
616
|
* ENTER key is commonly used on PCs and Unix and the RETURN key is used
|
617
617
|
* instead on Macintosh. Check for both ENTER and RETURN to make sure your
|
618
618
|
* program will work for all platforms.
|
619
|
-
*
|
619
|
+
*
|
620
620
|
* For users familiar with Java, the values for UP and DOWN are simply shorter
|
621
621
|
* versions of Java's KeyEvent.VK_UP and KeyEvent.VK_DOWN. Other keyCode
|
622
622
|
* values can be found in the Java <a
|
@@ -1133,7 +1133,7 @@ public class PApplet implements PConstants {
|
|
1133
1133
|
return 1;
|
1134
1134
|
} else if (suggestedDensity == 1 || suggestedDensity == 2) {
|
1135
1135
|
return suggestedDensity;
|
1136
|
-
}
|
1136
|
+
}
|
1137
1137
|
return 1;
|
1138
1138
|
}
|
1139
1139
|
|
@@ -1233,7 +1233,7 @@ public class PApplet implements PConstants {
|
|
1233
1233
|
* Called by the browser or applet viewer to inform this applet that it should
|
1234
1234
|
* start its execution. It is called after the init method and each time the
|
1235
1235
|
* applet is revisited in a Web page.
|
1236
|
-
*
|
1236
|
+
*
|
1237
1237
|
* Called explicitly via the first call to PApplet.paint(), because PAppletGL
|
1238
1238
|
* needs to have a usable screen before getting things rolling.
|
1239
1239
|
*/
|
@@ -1248,7 +1248,7 @@ public class PApplet implements PConstants {
|
|
1248
1248
|
/**
|
1249
1249
|
* Called by the browser or applet viewer to inform this applet that it should
|
1250
1250
|
* stop its execution.
|
1251
|
-
*
|
1251
|
+
*
|
1252
1252
|
* Unfortunately, there are no guarantees from the Java spec when or if stop()
|
1253
1253
|
* will be called (i.e. on browser quit, or when moving between web pages),
|
1254
1254
|
* and it's not always called.
|
@@ -1304,7 +1304,7 @@ public class PApplet implements PConstants {
|
|
1304
1304
|
// * Called by the browser or applet viewer to inform this applet
|
1305
1305
|
// * that it is being reclaimed and that it should destroy
|
1306
1306
|
// * any resources that it has allocated.
|
1307
|
-
// *
|
1307
|
+
// *
|
1308
1308
|
// * destroy() supposedly gets called as the applet viewer
|
1309
1309
|
// * is shutting down the applet. stop() is called
|
1310
1310
|
// * first, and then destroy() to really get rid of things.
|
@@ -1831,7 +1831,7 @@ public class PApplet implements PConstants {
|
|
1831
1831
|
* <b>size()</b> is not used, the default size of the window is 100x100
|
1832
1832
|
* pixels. The system variables <b>width</b> and <b>height</b> are set by the
|
1833
1833
|
* parameters passed to this function.
|
1834
|
-
*
|
1834
|
+
*
|
1835
1835
|
* Do not use variables as the parameters to <b>size()</b> function, because
|
1836
1836
|
* it will cause problems when exporting your sketch. When variables are used,
|
1837
1837
|
* the dimensions of your sketch cannot be determined during export. Instead,
|
@@ -1839,32 +1839,32 @@ public class PApplet implements PConstants {
|
|
1839
1839
|
* statement, and then use the built-in <b>width</b> and <b>height</b>
|
1840
1840
|
* variables inside your program when the dimensions of the display window are
|
1841
1841
|
* needed.
|
1842
|
-
*
|
1842
|
+
*
|
1843
1843
|
* The <b>size()</b> function can only be used once inside a sketch, and
|
1844
1844
|
* cannot be used for resizing.
|
1845
1845
|
* <b>renderer</b> parameter selects which rendering engine to use. For
|
1846
1846
|
* example, if you will be drawing 3D shapes, use <b>P3D</b>, if you want to
|
1847
1847
|
* export images from a program as a PDF file use <b>PDF</b>. A brief
|
1848
1848
|
* description of the three primary renderers follows:
|
1849
|
-
*
|
1849
|
+
*
|
1850
1850
|
* <b>P2D</b> (Processing 2D) - The default renderer that supports two
|
1851
1851
|
* dimensional drawing.
|
1852
|
-
*
|
1852
|
+
*
|
1853
1853
|
* <b>P3D</b> (Processing 3D) - 3D graphics renderer that makes use of
|
1854
1854
|
* OpenGL-compatible graphics hardware.
|
1855
|
-
*
|
1855
|
+
*
|
1856
1856
|
* <b>PDF</b> - The PDF renderer draws 2D graphics directly to an Acrobat PDF
|
1857
1857
|
* file. This produces excellent results when you need vector shapes for high
|
1858
1858
|
* resolution output or printing. You must first use Import Library → PDF
|
1859
1859
|
* to make use of the library. More information can be found in the PDF
|
1860
1860
|
* library reference.
|
1861
|
-
*
|
1861
|
+
*
|
1862
1862
|
* The P3D renderer doesn't support <b>strokeCap()</b> or
|
1863
1863
|
* <b>strokeJoin()</b>, which can lead to ugly results when using
|
1864
1864
|
* <b>strokeWeight()</b>. (<a
|
1865
1865
|
* href="http://code.google.com/p/processing/issues/detail?id=123">Issue
|
1866
|
-
* 123</a>)
|
1867
|
-
*
|
1866
|
+
* 123</a>)
|
1867
|
+
*
|
1868
1868
|
* The maximum width and height is limited by your operating system, and is
|
1869
1869
|
* usually the width and height of your actual screen. On some machines it may
|
1870
1870
|
* simply be the number of pixels on your current screen, meaning that a
|
@@ -1873,7 +1873,7 @@ public class PApplet implements PConstants {
|
|
1873
1873
|
* rendering modes and sizes until you get what you're looking for. If you
|
1874
1874
|
* need something larger, use <b>createGraphics</b> to create a non-visible
|
1875
1875
|
* drawing surface.
|
1876
|
-
*
|
1876
|
+
*
|
1877
1877
|
* Again, the <b>size()</b> function must be the first line of the code (or
|
1878
1878
|
* first item inside setup). Any code that appears before the <b>size()</b>
|
1879
1879
|
* command may run more than once, which can lead to confusing results.
|
@@ -2019,7 +2019,7 @@ public class PApplet implements PConstants {
|
|
2019
2019
|
* PDF renderer requires the filename parameter. The DXF renderer should not
|
2020
2020
|
* be used with <b>createGraphics()</b>, it's only built for use with
|
2021
2021
|
* <b>beginRaw()</b> and <b>endRaw()</b>.
|
2022
|
-
*
|
2022
|
+
*
|
2023
2023
|
* It's important to call any drawing functions between <b>beginDraw()</b>
|
2024
2024
|
* and <b>endDraw()</b> statements. This is also true for any functions that
|
2025
2025
|
* affect drawing, such as <b>smooth()</b> or <b>colorMode()</b>.
|
@@ -2236,10 +2236,10 @@ public class PApplet implements PConstants {
|
|
2236
2236
|
* <b>width</b> and <b>height</b> parameters. The <b>format</b> parameter
|
2237
2237
|
* defines how the pixels are stored. See the PImage reference for more
|
2238
2238
|
* information.
|
2239
|
-
*
|
2239
|
+
*
|
2240
2240
|
* Be sure to include all three parameters, specifying only the width and
|
2241
2241
|
* height (but no format) will produce a strange error.
|
2242
|
-
*
|
2242
|
+
*
|
2243
2243
|
* Advanced users please note that createImage() should be used instead of the
|
2244
2244
|
* syntax <tt>new PImage()</tt>.
|
2245
2245
|
*
|
@@ -2468,7 +2468,7 @@ public class PApplet implements PConstants {
|
|
2468
2468
|
* <b>draw()</b>. If <b>loop()</b> is called, the code in <b>draw()</b>
|
2469
2469
|
* begin to run continuously again. If using <b>noLoop()</b> in
|
2470
2470
|
* <b>setup()</b>, it should be the last line inside the block.
|
2471
|
-
*
|
2471
|
+
*
|
2472
2472
|
* When <b>noLoop()</b> is used, it's not possible to manipulate or access the
|
2473
2473
|
* screen inside event handling functions such as <b>mousePressed()</b>
|
2474
2474
|
* or <b>keyPressed()</b>. Instead, use those functions to call
|
@@ -2476,7 +2476,7 @@ public class PApplet implements PConstants {
|
|
2476
2476
|
* update the screen properly. This means that when noLoop() has been called,
|
2477
2477
|
* no drawing can happen, and functions like saveFrame() or loadPixels() may
|
2478
2478
|
* not be used.
|
2479
|
-
*
|
2479
|
+
*
|
2480
2480
|
* Note that if the sketch is resized, <b>redraw()</b> will be called to
|
2481
2481
|
* update the sketch, even after <b>noLoop()</b> has been specified.
|
2482
2482
|
* Otherwise, the sketch would enter an odd state until <b>loop()</b> was
|
@@ -2885,7 +2885,7 @@ public class PApplet implements PConstants {
|
|
2885
2885
|
*
|
2886
2886
|
* The <b>keyPressed()</b> function is called once every time a key is
|
2887
2887
|
* pressed. The key that was pressed is stored in the <b>key</b> variable.
|
2888
|
-
*
|
2888
|
+
*
|
2889
2889
|
* For non-ASCII keys, use the <b>keyCode</b> variable. The keys included in
|
2890
2890
|
* the ASCII specification (BACKSPACE, TAB, ENTER, RETURN, ESC, and DELETE) do
|
2891
2891
|
* not require checking to see if they key is coded, and you should simply use
|
@@ -2893,7 +2893,7 @@ public class PApplet implements PConstants {
|
|
2893
2893
|
* cross-platform projects, note that the ENTER key is commonly used on PCs
|
2894
2894
|
* and Unix and the RETURN key is used instead on Macintosh. Check for both
|
2895
2895
|
* ENTER and RETURN to make sure your program will work for all platforms.
|
2896
|
-
*
|
2896
|
+
*
|
2897
2897
|
* Because of how operating systems handle key repeats, holding down a key may
|
2898
2898
|
* cause multiple calls to keyPressed() (and keyReleased() as well). The rate
|
2899
2899
|
* of repeat is set by the operating system and how each computer is
|
@@ -3276,22 +3276,22 @@ public class PApplet implements PConstants {
|
|
3276
3276
|
* executable in the system's PATH. In most cases, using a full path is the
|
3277
3277
|
* best option, rather than relying on the system PATH. Be sure to make the
|
3278
3278
|
* file executable before attempting to open it (chmod +x).
|
3279
|
-
*
|
3279
|
+
*
|
3280
3280
|
* The <b>args</b> parameter is a String or String array which is passed to
|
3281
3281
|
* the command line. If you have multiple parameters, e.g. an application and
|
3282
3282
|
* a document, or a command with multiple switches, use the version that takes
|
3283
3283
|
* a String array, and place each individual item in a separate element.
|
3284
|
-
*
|
3284
|
+
*
|
3285
3285
|
* If args is a String (not an array), then it can only be a single file or
|
3286
3286
|
* application with no parameters. It's not the same as executing that String
|
3287
3287
|
* using a shell. For instance, launch("javac -help") will not work properly.
|
3288
|
-
*
|
3288
|
+
*
|
3289
3289
|
* This function behaves differently on each platform. On Windows, the
|
3290
3290
|
* parameters are sent to the Windows shell via "cmd /c". On Mac OS X, the
|
3291
3291
|
* "open" command is used (type "man open" in Terminal.app for documentation).
|
3292
3292
|
* On Linux, it first tries gnome-open, then kde-open, but if neither are
|
3293
3293
|
* available, it sends the command to the shell without any alterations.
|
3294
|
-
*
|
3294
|
+
*
|
3295
3295
|
* For users familiar with Java, this is not quite the same as Runtime.exec(),
|
3296
3296
|
* because the launcher command is prepended. Instead, the
|
3297
3297
|
* <b>exec(String[])</b> function is a shortcut for
|
@@ -3553,11 +3553,11 @@ public class PApplet implements PConstants {
|
|
3553
3553
|
* exit automatically after the last line has run, but programs with
|
3554
3554
|
* <b>draw()</b> run continuously until the program is manually stopped or
|
3555
3555
|
* <b>exit()</b> is run.
|
3556
|
-
*
|
3556
|
+
*
|
3557
3557
|
* Rather than terminating immediately, <b>exit()</b> will cause the sketch to
|
3558
3558
|
* exit after <b>draw()</b> has completed (or after <b>setup()</b>
|
3559
3559
|
* completes if called during the <b>setup()</b> function).
|
3560
|
-
*
|
3560
|
+
*
|
3561
3561
|
* For Java programmers, this is <em>not</em> the same as System.exit().
|
3562
3562
|
* Further, System.exit() should not be used because closing out an
|
3563
3563
|
* application while <b>draw()</b> is running may cause a crash (particularly
|
@@ -3634,7 +3634,7 @@ public class PApplet implements PConstants {
|
|
3634
3634
|
//////////////////////////////////////////////////////////////
|
3635
3635
|
/**
|
3636
3636
|
* Call a method in the current class based on its name.
|
3637
|
-
*
|
3637
|
+
*
|
3638
3638
|
* Note that the function being called must be public. Inside the PDE,
|
3639
3639
|
* 'public' is automatically added, but when used without the preprocessor,
|
3640
3640
|
* (like from Eclipse) you'll have to do it yourself.
|
@@ -3662,7 +3662,7 @@ public class PApplet implements PConstants {
|
|
3662
3662
|
* Launch a new thread and call the specified function from that new thread.
|
3663
3663
|
* This is a very simple way to do a thread without needing to get into
|
3664
3664
|
* classes, runnables, etc.
|
3665
|
-
*
|
3665
|
+
*
|
3666
3666
|
* Note that the function being called must be public. Inside the PDE,
|
3667
3667
|
* 'public' is automatically added, but when used without the preprocessor,
|
3668
3668
|
* (like from Eclipse) you'll have to do it yourself.
|
@@ -3738,7 +3738,7 @@ public class PApplet implements PConstants {
|
|
3738
3738
|
* and made into movies. These files are saved to the sketch's folder, which
|
3739
3739
|
* may be opened by selecting "Show sketch folder" from the "Sketch"
|
3740
3740
|
* menu.
|
3741
|
-
*
|
3741
|
+
*
|
3742
3742
|
* It is not possible to use saveXxxxx() functions inside a web browser unless
|
3743
3743
|
* the sketch is <a
|
3744
3744
|
* href="http://wiki.processing.org/w/Sign_an_Applet">signed applet</A>. To
|
@@ -3816,7 +3816,7 @@ public class PApplet implements PConstants {
|
|
3816
3816
|
* load an image as the cursor if you are exporting your program for the Web
|
3817
3817
|
* and not all MODES work with all Web browsers. The values for parameters
|
3818
3818
|
* <b>x</b> and <b>y</b> must be less than the dimensions of the image.
|
3819
|
-
*
|
3819
|
+
*
|
3820
3820
|
* Setting or hiding the cursor generally does not work with "Present" mode
|
3821
3821
|
* (when running full-screen).
|
3822
3822
|
*
|
@@ -3875,14 +3875,14 @@ public class PApplet implements PConstants {
|
|
3875
3875
|
* function <b>println()</b> works like <b>print()</b>, but creates a new line
|
3876
3876
|
* of text for each call to the function. Individual elements can be separated
|
3877
3877
|
* with quotes ("") and joined with the addition operator (+).
|
3878
|
-
*
|
3878
|
+
*
|
3879
3879
|
* Beginning with release 0125, to print the contents of an array, use
|
3880
3880
|
* println(). There's no sensible way to do a <b>print()</b> of an array,
|
3881
3881
|
* because there are too many possibilities for how to separate the data
|
3882
3882
|
* (spaces, commas, etc). If you want to print an array as a single line, use
|
3883
3883
|
* <b>join()</b>. With <b>join()</b>, you can choose any delimiter you like
|
3884
3884
|
* and <b>print()</b> the result.
|
3885
|
-
*
|
3885
|
+
*
|
3886
3886
|
* Using <b>print()</b> on an object will output <b>null</b>, a memory
|
3887
3887
|
* location that may look like "@10be08," or the result of the
|
3888
3888
|
* <b>toString()</b> method from the object that's being printed. Advanced
|
@@ -4799,9 +4799,9 @@ public class PApplet implements PConstants {
|
|
4799
4799
|
* ( begin auto-generated from norm.xml )
|
4800
4800
|
*
|
4801
4801
|
* Normalizes a number from another range into a value between 0 and 1.
|
4802
|
-
*
|
4802
|
+
*
|
4803
4803
|
* Identical to map(value, low, high, 0, 1);
|
4804
|
-
*
|
4804
|
+
*
|
4805
4805
|
* Numbers outside the range are not clamped to 0 and 1, because out-of-range
|
4806
4806
|
* values are often intentional and useful.
|
4807
4807
|
*
|
@@ -4824,7 +4824,7 @@ public class PApplet implements PConstants {
|
|
4824
4824
|
* Re-maps a number from one range to another. In the example above, the
|
4825
4825
|
* number '25' is converted from a value in the range 0..100 into a value that
|
4826
4826
|
* ranges from the left edge (0) to the right edge (width) of the screen.
|
4827
|
-
*
|
4827
|
+
*
|
4828
4828
|
* Numbers outside the range are not clamped to 0 and 1, because out-of-range
|
4829
4829
|
* values are often intentional and useful.
|
4830
4830
|
*
|
@@ -6071,18 +6071,18 @@ public class PApplet implements PConstants {
|
|
6071
6071
|
* font to use with Processing, select "Create Font..." from the Tools menu.
|
6072
6072
|
* This will create a font in the format Processing requires and also adds it
|
6073
6073
|
* to the current sketch's data directory.
|
6074
|
-
*
|
6074
|
+
*
|
6075
6075
|
* Like <b>loadImage()</b> and other functions that load data, the
|
6076
6076
|
* <b>loadFont()</b> function should not be used inside <b>draw()</b>, because
|
6077
6077
|
* it will slow down the sketch considerably, as the font will be re-loaded
|
6078
6078
|
* from the disk (or network) on each frame.
|
6079
|
-
*
|
6079
|
+
*
|
6080
6080
|
* For most renderers, Processing displays fonts using the .vlw font format,
|
6081
6081
|
* which uses images for each letter, rather than defining them through vector
|
6082
6082
|
* data. When <b>hint(ENABLE_NATIVE_FONTS)</b> is used with the JAVA2D
|
6083
6083
|
* renderer, the native version of a font will be used if it is installed on
|
6084
6084
|
* the user's machine.
|
6085
|
-
*
|
6085
|
+
*
|
6086
6086
|
* Using <b>createFont()</b> (instead of loadFont) enables vector data to be
|
6087
6087
|
* used with the JAVA2D (default) renderer setting. This can be helpful when
|
6088
6088
|
* many font sizes are needed, or when using any renderer based on JAVA2D,
|
@@ -6128,7 +6128,7 @@ public class PApplet implements PConstants {
|
|
6128
6128
|
* inside the sketches "data" folder. This function is an advanced feature for
|
6129
6129
|
* precise control. On most occasions you should create fonts through
|
6130
6130
|
* selecting "Create Font..." from the Tools menu.
|
6131
|
-
*
|
6131
|
+
*
|
6132
6132
|
* Use the <b>PFont.list()</b> method to first determine the names for the
|
6133
6133
|
* fonts recognized by the computer and are compatible with this function.
|
6134
6134
|
* Because of limitations in Java, not all fonts can be used and some might
|
@@ -6137,12 +6137,12 @@ public class PApplet implements PConstants {
|
|
6137
6137
|
* .otf version of your font in the data directory of the sketch because other
|
6138
6138
|
* people might not have the font installed on their computer. Only fonts that
|
6139
6139
|
* can legally be distributed should be included with a sketch.
|
6140
|
-
*
|
6140
|
+
*
|
6141
6141
|
* The <b>size</b> parameter states the font size you want to generate. The
|
6142
6142
|
* <b>smooth</b> parameter specifies if the font should be antialiased or not,
|
6143
6143
|
* and the <b>charset</b> parameter is an array of chars that specifies the
|
6144
6144
|
* characters to generate.
|
6145
|
-
*
|
6145
|
+
*
|
6146
6146
|
* This function creates a bitmapped version of a font in the same manner as
|
6147
6147
|
* the Create Font tool. It loads a font by name, and converts it to a series
|
6148
6148
|
* of images based on the size of the font. When possible, the
|
@@ -6308,27 +6308,27 @@ public class PApplet implements PConstants {
|
|
6308
6308
|
final PApplet sketch) {
|
6309
6309
|
EventQueue.invokeLater(() -> {
|
6310
6310
|
File selectedFile = null;
|
6311
|
-
|
6311
|
+
|
6312
6312
|
// boolean hide = (sketch != null)
|
6313
6313
|
// && (sketch.g instanceof PGraphicsOpenGL) && (platform == WINDOWS);
|
6314
6314
|
// if (hide) {
|
6315
6315
|
// sketch.surface.setVisible(false);
|
6316
6316
|
// }
|
6317
|
-
|
6317
|
+
|
6318
6318
|
if (useNativeSelect) {
|
6319
6319
|
FileDialog dialog = new FileDialog(parentFrame, prompt, mode);
|
6320
6320
|
if (defaultSelection != null) {
|
6321
6321
|
dialog.setDirectory(defaultSelection.getParent());
|
6322
6322
|
dialog.setFile(defaultSelection.getName());
|
6323
6323
|
}
|
6324
|
-
|
6324
|
+
|
6325
6325
|
dialog.setVisible(true);
|
6326
6326
|
String directory = dialog.getDirectory();
|
6327
6327
|
String filename = dialog.getFile();
|
6328
6328
|
if (filename != null) {
|
6329
6329
|
selectedFile = new File(directory, filename);
|
6330
6330
|
}
|
6331
|
-
|
6331
|
+
|
6332
6332
|
} else {
|
6333
6333
|
JFileChooser chooser = new JFileChooser();
|
6334
6334
|
chooser.setDialogTitle(prompt);
|
@@ -6346,7 +6346,7 @@ public class PApplet implements PConstants {
|
|
6346
6346
|
selectedFile = chooser.getSelectedFile();
|
6347
6347
|
}
|
6348
6348
|
}
|
6349
|
-
|
6349
|
+
|
6350
6350
|
// if (hide) {
|
6351
6351
|
// sketch.surface.setVisible(true);
|
6352
6352
|
// }
|
@@ -6392,13 +6392,13 @@ public class PApplet implements PConstants {
|
|
6392
6392
|
final PApplet sketch) {
|
6393
6393
|
EventQueue.invokeLater(() -> {
|
6394
6394
|
File selectedFile = null;
|
6395
|
-
|
6395
|
+
|
6396
6396
|
// boolean hide = (sketch != null)
|
6397
6397
|
// && (sketch.g instanceof PGraphicsOpenGL) && (platform == WINDOWS);
|
6398
6398
|
// if (hide) {
|
6399
6399
|
// sketch.surface.setVisible(false);
|
6400
6400
|
// }
|
6401
|
-
|
6401
|
+
|
6402
6402
|
checkLookAndFeel();
|
6403
6403
|
JFileChooser fileChooser = new JFileChooser();
|
6404
6404
|
fileChooser.setDialogTitle(prompt);
|
@@ -6406,15 +6406,15 @@ public class PApplet implements PConstants {
|
|
6406
6406
|
if (defaultSelection != null) {
|
6407
6407
|
fileChooser.setCurrentDirectory(defaultSelection);
|
6408
6408
|
}
|
6409
|
-
|
6409
|
+
|
6410
6410
|
int result = fileChooser.showOpenDialog(parentFrame);
|
6411
6411
|
if (result == JFileChooser.APPROVE_OPTION) {
|
6412
6412
|
selectedFile = fileChooser.getSelectedFile();
|
6413
6413
|
}
|
6414
|
-
|
6415
|
-
|
6414
|
+
|
6415
|
+
|
6416
6416
|
// if (hide) sketch.surface.setVisible (
|
6417
|
-
//
|
6417
|
+
//
|
6418
6418
|
// true);
|
6419
6419
|
selectCallback(selectedFile, callbackMethod, callbackObject);
|
6420
6420
|
});
|
@@ -6429,7 +6429,7 @@ public class PApplet implements PConstants {
|
|
6429
6429
|
Method selectMethod =
|
6430
6430
|
callbackClass.getMethod(callbackMethod, new Class[] { File
|
6431
6431
|
|
6432
|
-
.class
|
6432
|
+
.class
|
6433
6433
|
});
|
6434
6434
|
selectMethod.invoke(callbackObject, new Object[] { selectedFile });
|
6435
6435
|
|
@@ -6607,7 +6607,7 @@ public class PApplet implements PConstants {
|
|
6607
6607
|
* Creates a <b>BufferedReader</b> object that can be used to read files
|
6608
6608
|
* line-by-line as individual <b>String</b> objects. This is the complement
|
6609
6609
|
* to the <b>createWriter()</b> function.
|
6610
|
-
*
|
6610
|
+
*
|
6611
6611
|
* Starting with Processing release 0134, all files loaded and saved by the
|
6612
6612
|
* Processing API use UTF-8 encoding. In previous releases, the default
|
6613
6613
|
* encoding for your platform was used, which causes problems when files
|
@@ -6682,7 +6682,7 @@ public class PApplet implements PConstants {
|
|
6682
6682
|
* to write to it. For the file to be made correctly, it should be flushed
|
6683
6683
|
* and must be closed with its <b>flush()</b> and <b>close()</b> methods
|
6684
6684
|
* (see above example).
|
6685
|
-
*
|
6685
|
+
*
|
6686
6686
|
* Starting with Processing release 0134, all files loaded and saved by the
|
6687
6687
|
* Processing API use UTF-8 encoding. In previous releases, the default
|
6688
6688
|
* encoding for your platform was used, which causes problems when files
|
@@ -6751,13 +6751,13 @@ public class PApplet implements PConstants {
|
|
6751
6751
|
* easily open files from the data folder or from a URL, but want an
|
6752
6752
|
* InputStream object so that you can use other parts of Java to take more
|
6753
6753
|
* control of how the stream is read.
|
6754
|
-
*
|
6754
|
+
*
|
6755
6755
|
* The filename passed in can be:
|
6756
6756
|
* - A URL, for instance <b>openStream("http://processing.org/")</b>
|
6757
6757
|
* - A file in the sketch's <b>data</b> folder
|
6758
6758
|
* - The full path to a file to be opened locally (when running as an
|
6759
6759
|
* application)
|
6760
|
-
*
|
6760
|
+
*
|
6761
6761
|
* If the requested item doesn't exist, null is returned. If not online,
|
6762
6762
|
* this will also check to see if the user is asking for a file whose name
|
6763
6763
|
* isn't properly capitalized. If capitalization is different, an error
|
@@ -6765,13 +6765,13 @@ public class PApplet implements PConstants {
|
|
6765
6765
|
* when a sketch is exported to the web, where case sensitivity matters, as
|
6766
6766
|
* opposed to running from inside the Processing Development Environment on
|
6767
6767
|
* Windows or Mac OS, where case sensitivity is preserved but ignored.
|
6768
|
-
*
|
6768
|
+
*
|
6769
6769
|
* If the file ends with <b>.gz</b>, the stream will automatically be gzip
|
6770
6770
|
* decompressed. If you don't want the automatic decompression, use the
|
6771
6771
|
* related function <b>createInputRaw()</b>.
|
6772
|
-
*
|
6772
|
+
*
|
6773
6773
|
* In earlier releases, this function was called <b>openStream()</b>.
|
6774
|
-
*
|
6774
|
+
*
|
6775
6775
|
*
|
6776
6776
|
* ( end auto-generated )
|
6777
6777
|
*
|
@@ -7025,7 +7025,7 @@ public class PApplet implements PConstants {
|
|
7025
7025
|
* Reads the contents of a file or url and places it in a byte array. If a
|
7026
7026
|
* file is specified, it must be located in the sketch's "data"
|
7027
7027
|
* directory/folder.
|
7028
|
-
*
|
7028
|
+
*
|
7029
7029
|
* The filename parameter can also be a URL to a file found online. For
|
7030
7030
|
* security reasons, a Processing sketch found online can only download
|
7031
7031
|
* files from the same server from which it came. Getting around this
|
@@ -7232,19 +7232,19 @@ public class PApplet implements PConstants {
|
|
7232
7232
|
* Reads the contents of a file or url and creates a String array of its
|
7233
7233
|
* individual lines. If a file is specified, it must be located in the
|
7234
7234
|
* sketch's "data" directory/folder.
|
7235
|
-
*
|
7235
|
+
*
|
7236
7236
|
* The filename parameter can also be a URL to a file found online. For
|
7237
7237
|
* security reasons, a Processing sketch found online can only download
|
7238
7238
|
* files from the same server from which it came. Getting around this
|
7239
7239
|
* restriction requires a <a
|
7240
7240
|
* href="http://wiki.processing.org/w/Sign_an_Applet">signed applet</a>.
|
7241
|
-
*
|
7241
|
+
*
|
7242
7242
|
* If the file is not available or an error occurs, <b>null</b> will be
|
7243
7243
|
* returned and an error message will be printed to the console. The error
|
7244
7244
|
* message does not halt the program, however the null value may cause a
|
7245
7245
|
* NullPointerException if your code does not check whether the value
|
7246
7246
|
* returned is null.
|
7247
|
-
*
|
7247
|
+
*
|
7248
7248
|
* Starting with Processing release 0134, all files loaded and saved by the
|
7249
7249
|
* Processing API use UTF-8 encoding. In previous releases, the default
|
7250
7250
|
* encoding for your platform was used, which causes problems when files
|
@@ -7329,7 +7329,7 @@ public class PApplet implements PConstants {
|
|
7329
7329
|
|
7330
7330
|
} catch (IOException e) {
|
7331
7331
|
//throw new RuntimeException("Error inside loadStrings()");
|
7332
|
-
|
7332
|
+
|
7333
7333
|
}
|
7334
7334
|
return null;
|
7335
7335
|
}
|
@@ -7347,16 +7347,16 @@ public class PApplet implements PConstants {
|
|
7347
7347
|
* Similar to <b>createInput()</b>, this creates a Java <b>OutputStream</b>
|
7348
7348
|
* for a given filename or path. The file will be created in the sketch
|
7349
7349
|
* folder, or in the same folder as an exported application.
|
7350
|
-
*
|
7350
|
+
*
|
7351
7351
|
* If the path does not exist, intermediate folders will be created. If an
|
7352
7352
|
* exception occurs, it will be printed to the console, and <b>null</b>
|
7353
7353
|
* will be returned.
|
7354
|
-
*
|
7354
|
+
*
|
7355
7355
|
* This function is a convenience over the Java approach that requires you
|
7356
7356
|
* to 1) create a FileOutputStream object, 2) determine the exact file
|
7357
7357
|
* location, and 3) handle exceptions. Exceptions are handled internally by
|
7358
7358
|
* the function, which is more appropriate for "sketch" projects.
|
7359
|
-
*
|
7359
|
+
*
|
7360
7360
|
* If the output filename ends with <b>.gz</b>, the output will be
|
7361
7361
|
* automatically GZIP compressed as it is written.
|
7362
7362
|
*
|
@@ -7394,7 +7394,7 @@ public class PApplet implements PConstants {
|
|
7394
7394
|
* Save the contents of a stream to a file in the sketch folder. This is
|
7395
7395
|
* basically <b>saveBytes(blah, loadBytes())</b>, but done more efficiently
|
7396
7396
|
* (and with less confusing syntax).
|
7397
|
-
*
|
7397
|
+
*
|
7398
7398
|
* When using the <b>targetFile</b> parameter, it writes to a <b>File</b>
|
7399
7399
|
* object for greater control over the file location. (Note that unlike
|
7400
7400
|
* some other functions, this will not automatically compress or uncompress
|
@@ -7414,7 +7414,7 @@ public class PApplet implements PConstants {
|
|
7414
7414
|
/**
|
7415
7415
|
* Identical to the other saveStream(), but writes to a File
|
7416
7416
|
* object, for greater control over the file location.
|
7417
|
-
*
|
7417
|
+
*
|
7418
7418
|
* Note that unlike other api methods, this will not automatically
|
7419
7419
|
* compress or uncompress gzip files.
|
7420
7420
|
*/
|
@@ -7488,7 +7488,7 @@ public class PApplet implements PConstants {
|
|
7488
7488
|
* file. The data is saved in binary format. This file is saved to the
|
7489
7489
|
* sketch's folder, which is opened by selecting "Show sketch folder" from
|
7490
7490
|
* the "Sketch" menu.
|
7491
|
-
*
|
7491
|
+
*
|
7492
7492
|
* It is not possible to use saveXxxxx() functions inside a web browser
|
7493
7493
|
* unless the sketch is <a
|
7494
7494
|
* href="http://wiki.processing.org/w/Sign_an_Applet">signed applet</A>. To
|
@@ -7596,7 +7596,7 @@ public class PApplet implements PConstants {
|
|
7596
7596
|
* Writes an array of strings to a file, one line per string. This file is
|
7597
7597
|
* saved to the sketch's folder, which is opened by selecting "Show sketch
|
7598
7598
|
* folder" from the "Sketch" menu.
|
7599
|
-
*
|
7599
|
+
*
|
7600
7600
|
* It is not possible to use saveXxxxx() functions inside a web browser
|
7601
7601
|
* unless the sketch is <a
|
7602
7602
|
* href="http://wiki.processing.org/w/Sign_an_Applet">signed applet</A>. To
|
@@ -7657,7 +7657,7 @@ public class PApplet implements PConstants {
|
|
7657
7657
|
URL jarURL =
|
7658
7658
|
PApplet
|
7659
7659
|
|
7660
|
-
.class
|
7660
|
+
.class
|
7661
7661
|
|
7662
7662
|
|
7663
7663
|
.getProtectionDomain().getCodeSource().getLocation();
|
@@ -7698,11 +7698,11 @@ public class PApplet implements PConstants {
|
|
7698
7698
|
* Prepend the sketch folder path to the filename (or path) that is
|
7699
7699
|
* passed in. External libraries should use this function to save to
|
7700
7700
|
* the sketch folder.
|
7701
|
-
*
|
7701
|
+
*
|
7702
7702
|
* Note that when running as an applet inside a web browser,
|
7703
7703
|
* the sketchPath will be set to null, because security restrictions
|
7704
7704
|
* prevent applets from accessing that information.
|
7705
|
-
*
|
7705
|
+
*
|
7706
7706
|
* This will also cause an error if the sketch is not inited properly,
|
7707
7707
|
* meaning that init() was never called on the PApplet when hosted
|
7708
7708
|
* my some other main() or by other code. For proper use of init(),
|
@@ -7731,7 +7731,7 @@ public class PApplet implements PConstants {
|
|
7731
7731
|
/**
|
7732
7732
|
* Returns a path inside the applet folder to save to. Like sketchPath(),
|
7733
7733
|
* but creates any in-between folders so that things save properly.
|
7734
|
-
*
|
7734
|
+
*
|
7735
7735
|
* All saveXxxx() functions use the path to the sketch folder, rather than
|
7736
7736
|
* its data folder. Once exported, the data folder will be found inside the
|
7737
7737
|
* jar file of the exported application or applet. In this case, it's not
|
@@ -7766,7 +7766,7 @@ public class PApplet implements PConstants {
|
|
7766
7766
|
desktopFolder = new File(System.getProperty("user.home"), "Desktop");
|
7767
7767
|
if (!desktopFolder.exists()) {
|
7768
7768
|
throw new UnsupportedOperationException("Could not find a suitable desktop foldder");
|
7769
|
-
}
|
7769
|
+
}
|
7770
7770
|
}
|
7771
7771
|
return new File(desktopFolder, what);
|
7772
7772
|
}
|
@@ -8080,7 +8080,7 @@ public class PApplet implements PConstants {
|
|
8080
8080
|
* Increases the size of an array. By default, this function doubles the
|
8081
8081
|
* size of the array, but the optional <b>newSize</b> parameter provides
|
8082
8082
|
* precise control over the increase in size.
|
8083
|
-
*
|
8083
|
+
*
|
8084
8084
|
* When using an array of objects, the data returned from the function must
|
8085
8085
|
* be cast to the object array's data type. For example: <em>SomeClass[]
|
8086
8086
|
* items = (SomeClass[]) expand(originalArray)</em>.
|
@@ -8200,7 +8200,7 @@ public class PApplet implements PConstants {
|
|
8200
8200
|
* Expands an array by one element and adds data to the new position. The
|
8201
8201
|
* datatype of the <b>element</b> parameter must be the same as the
|
8202
8202
|
* datatype of the array.
|
8203
|
-
*
|
8203
|
+
*
|
8204
8204
|
* When using an array of objects, the data returned from the function must
|
8205
8205
|
* be cast to the object array's data type. For example: <em>SomeClass[]
|
8206
8206
|
* items = (SomeClass[]) append(originalArray, element)</em>.
|
@@ -8255,7 +8255,7 @@ public class PApplet implements PConstants {
|
|
8255
8255
|
* ( begin auto-generated from shorten.xml )
|
8256
8256
|
*
|
8257
8257
|
* Decreases an array by one element and returns the shortened array.
|
8258
|
-
*
|
8258
|
+
*
|
8259
8259
|
* When using an array of objects, the data returned from the function must
|
8260
8260
|
* be cast to the object array's data type. For example: <em>SomeClass[]
|
8261
8261
|
* items = (SomeClass[]) shorten(originalArray)</em>.
|
@@ -8304,7 +8304,7 @@ public class PApplet implements PConstants {
|
|
8304
8304
|
* parameters must be of the same datatype. The <b>array</b> parameter
|
8305
8305
|
* defines the array which will be modified and the second parameter
|
8306
8306
|
* defines the data which will be inserted.
|
8307
|
-
*
|
8307
|
+
*
|
8308
8308
|
* When using an array of objects, the data returned from the function must
|
8309
8309
|
* be cast to the object array's data type. For example: <em>SomeClass[]
|
8310
8310
|
* items = (SomeClass[]) splice(array1, array2, index)</em>.
|
@@ -8476,7 +8476,7 @@ public class PApplet implements PConstants {
|
|
8476
8476
|
* from the <b>offset</b> to the end of the array. When specifying the
|
8477
8477
|
* <b>offset</b> remember the first array element is 0. This function does
|
8478
8478
|
* not change the source array.
|
8479
|
-
*
|
8479
|
+
*
|
8480
8480
|
* When using an array of objects, the data returned from the function must
|
8481
8481
|
* be cast to the object array's data type. For example: <em>SomeClass[]
|
8482
8482
|
* items = (SomeClass[]) subset(originalArray, 0, 4)</em>.
|
@@ -8599,7 +8599,7 @@ public class PApplet implements PConstants {
|
|
8599
8599
|
* Concatenates two arrays. For example, concatenating the array { 1, 2, 3
|
8600
8600
|
* } and the array { 4, 5, 6 } yields { 1, 2, 3, 4, 5, 6 }. Both parameters
|
8601
8601
|
* must be arrays of the same datatype.
|
8602
|
-
*
|
8602
|
+
*
|
8603
8603
|
* When using an array of objects, the data returned from the function must
|
8604
8604
|
* be cast to the object array's data type. For example: <em>SomeClass[]
|
8605
8605
|
* items = (SomeClass[]) concat(array1, array2)</em>.
|
@@ -8828,7 +8828,7 @@ public class PApplet implements PConstants {
|
|
8828
8828
|
* The splitTokens() function splits a String at one or many character
|
8829
8829
|
* "tokens." The <b>tokens</b> parameter specifies the character or
|
8830
8830
|
* characters to be used as a boundary.
|
8831
|
-
*
|
8831
|
+
*
|
8832
8832
|
* If no <b>tokens</b> character is specified, any whitespace character is
|
8833
8833
|
* used to split. Whitespace characters include tab (\\t), line feed (\\n),
|
8834
8834
|
* carriage return (\\r), form feed (\\f), and space. To convert a String
|
@@ -8862,11 +8862,11 @@ public class PApplet implements PConstants {
|
|
8862
8862
|
* string as the divider. The <b>delim</b> parameter specifies the
|
8863
8863
|
* character or characters that mark the boundaries between each piece. A
|
8864
8864
|
* String[] array is returned that contains each of the pieces.
|
8865
|
-
*
|
8865
|
+
*
|
8866
8866
|
* If the result is a set of numbers, you can convert the String[] array to
|
8867
8867
|
* to a float[] or int[] array using the datatype conversion functions
|
8868
8868
|
* <b>int()</b> and <b>float()</b> (see example above).
|
8869
|
-
*
|
8869
|
+
*
|
8870
8870
|
* The <b>splitTokens()</b> function works in a similar fashion, except
|
8871
8871
|
* that it splits using a range of characters instead of a specific
|
8872
8872
|
* character or sequence.
|
@@ -8976,7 +8976,7 @@ public class PApplet implements PConstants {
|
|
8976
8976
|
* a String array. No match will return null. If no groups are specified in
|
8977
8977
|
* the regexp, but the sequence matches, an array of length one (with the
|
8978
8978
|
* matched text as the first element of the array) will be returned.
|
8979
|
-
*
|
8979
|
+
*
|
8980
8980
|
* To use the function, first check to see if the result is null. If the
|
8981
8981
|
* result is null, then the sequence did not match. If the sequence did
|
8982
8982
|
* match, an array is returned.
|
@@ -8985,7 +8985,7 @@ public class PApplet implements PConstants {
|
|
8985
8985
|
* Element [0] of a regexp match returns the entire matching string, and
|
8986
8986
|
* the match groups start at element [1] (the first group is [1], the
|
8987
8987
|
* second [2], and so on).
|
8988
|
-
*
|
8988
|
+
*
|
8989
8989
|
* The syntax can be found in the reference for Java's <a
|
8990
8990
|
* href="http://download.oracle.com/javase/6/docs/api/">Pattern</a> class.
|
8991
8991
|
* For regular expression syntax, read the <a
|
@@ -9026,7 +9026,7 @@ public class PApplet implements PConstants {
|
|
9026
9026
|
* groups are specified in the regexp, but the sequence matches, a two
|
9027
9027
|
* dimensional array is still returned, but the second dimension is only of
|
9028
9028
|
* length one.
|
9029
|
-
*
|
9029
|
+
*
|
9030
9030
|
* To use the function, first check to see if the result is null. If the
|
9031
9031
|
* result is null, then the sequence did not match at all. If the sequence
|
9032
9032
|
* did match, a 2D array is returned. If there are groups (specified by
|
@@ -9036,7 +9036,7 @@ public class PApplet implements PConstants {
|
|
9036
9036
|
* match returns the entire matching string, and the match groups start at
|
9037
9037
|
* element [i][1] (the first group is [i][1], the second [i][2], and so
|
9038
9038
|
* on).
|
9039
|
-
*
|
9039
|
+
*
|
9040
9040
|
* The syntax can be found in the reference for Java's <a
|
9041
9041
|
* href="http://download.oracle.com/javase/6/docs/api/">Pattern</a> class.
|
9042
9042
|
* For regular expression syntax, read the <a
|
@@ -9661,7 +9661,7 @@ public class PApplet implements PConstants {
|
|
9661
9661
|
* appropriate commas to mark units of 1000. There are two versions, one
|
9662
9662
|
* for formatting ints and one for formatting an array of ints. The value
|
9663
9663
|
* for the <b>digits</b> parameter should always be a positive integer.
|
9664
|
-
*
|
9664
|
+
*
|
9665
9665
|
* For a non-US locale, this will insert periods instead of commas, or
|
9666
9666
|
* whatever is apprioriate for that region.
|
9667
9667
|
*
|
@@ -9901,7 +9901,7 @@ public class PApplet implements PConstants {
|
|
9901
9901
|
* equivalent hexadecimal notation. For example color(0, 102, 153) will
|
9902
9902
|
* convert to the String "FF006699". This function can help make your geeky
|
9903
9903
|
* debugging sessions much happier.
|
9904
|
-
*
|
9904
|
+
*
|
9905
9905
|
* Note that the maximum number of digits is 8, because an int value can
|
9906
9906
|
* only represent up to 32 bits. Specifying more than eight digits will
|
9907
9907
|
* simply shorten the string to eight anyway.
|
@@ -10002,7 +10002,7 @@ public class PApplet implements PConstants {
|
|
10002
10002
|
* equivalent binary notation. For example color(0, 102, 153, 255) will
|
10003
10003
|
* convert to the String "11111111000000000110011010011001". This function
|
10004
10004
|
* can help make your geeky debugging sessions much happier.
|
10005
|
-
*
|
10005
|
+
*
|
10006
10006
|
* Note that the maximum number of digits is 32, because an int value can
|
10007
10007
|
* only represent up to 32 bits. Specifying more than 32 digits will simply
|
10008
10008
|
* shorten the string to 32 anyway.
|
@@ -10502,7 +10502,7 @@ public class PApplet implements PConstants {
|
|
10502
10502
|
switch (args[argIndex]) {
|
10503
10503
|
case ARGS_PRESENT:
|
10504
10504
|
present = true;
|
10505
|
-
|
10505
|
+
|
10506
10506
|
// } else if (args[argIndex].equals(ARGS_SPAN_DISPLAYS)) {
|
10507
10507
|
// spanDisplays = true;
|
10508
10508
|
break;
|
@@ -10556,12 +10556,12 @@ public class PApplet implements PConstants {
|
|
10556
10556
|
Method method =
|
10557
10557
|
thinkDifferent.getMethod("init", new Class[] { PApplet
|
10558
10558
|
|
10559
|
-
.class
|
10559
|
+
.class
|
10560
10560
|
});
|
10561
10561
|
method.invoke(null, new Object[] { sketch });
|
10562
10562
|
} catch (ClassNotFoundException | IllegalAccessException | IllegalArgumentException | NoSuchMethodException | SecurityException | InvocationTargetException e) {
|
10563
10563
|
// That's unfortunate
|
10564
|
-
|
10564
|
+
|
10565
10565
|
}
|
10566
10566
|
}
|
10567
10567
|
|
@@ -10705,8 +10705,8 @@ public class PApplet implements PConstants {
|
|
10705
10705
|
|
10706
10706
|
@Override
|
10707
10707
|
public void setUndecorated(boolean ignored) {
|
10708
|
-
throw new RuntimeException("'frame' has been removed from
|
10709
|
-
"use
|
10708
|
+
throw new RuntimeException("'frame' has been removed from Processing 3, " +
|
10709
|
+
"use fullScreen() to get an undecorated full screen frame");
|
10710
10710
|
}
|
10711
10711
|
|
10712
10712
|
// Can't override this one because it's called by Window's constructor
|
@@ -10725,14 +10725,14 @@ public class PApplet implements PConstants {
|
|
10725
10725
|
}
|
10726
10726
|
|
10727
10727
|
private void deprecationWarning(String method) {
|
10728
|
-
PGraphics.showWarning("Use surface." + method + " instead of " +
|
10729
|
-
"frame." + method + " in
|
10728
|
+
PGraphics.showWarning("Use surface." + method + "() instead of " +
|
10729
|
+
"frame." + method + " in Processing 3");
|
10730
10730
|
//new Exception(method).printStackTrace(System.out);
|
10731
10731
|
}
|
10732
10732
|
};
|
10733
10733
|
|
10734
10734
|
surface.initFrame(this); //, backgroundColor, displayNum, fullScreen, spanDisplays);
|
10735
|
-
surface.setTitle("
|
10735
|
+
surface.setTitle("Picrate 1.2 Sketch");
|
10736
10736
|
|
10737
10737
|
} else {
|
10738
10738
|
surface.initOffscreen(this); // for PDF/PSurfaceNone and friends
|
@@ -10817,7 +10817,7 @@ public class PApplet implements PConstants {
|
|
10817
10817
|
* requires two parameters, the first is the renderer and the second is the
|
10818
10818
|
* file name. This function is always used with <b>endRecord()</b> to stop
|
10819
10819
|
* the recording process and close the file.
|
10820
|
-
*
|
10820
|
+
*
|
10821
10821
|
* Note that beginRecord() will only pick up any settings that happen after
|
10822
10822
|
* it has been called. For instance, if you call textFont() before
|
10823
10823
|
* beginRecord(), then that font will not be set for the file that you're
|
@@ -10878,21 +10878,21 @@ public class PApplet implements PConstants {
|
|
10878
10878
|
* hundreds of triangles, rather than a single object. Or that a
|
10879
10879
|
* multi-segment line shape (such as a curve) will be rendered as
|
10880
10880
|
* individual segments.
|
10881
|
-
*
|
10881
|
+
*
|
10882
10882
|
* When using <b>beginRaw()</b> and <b>endRaw()</b>, it's possible to write
|
10883
10883
|
* to either a 2D or 3D renderer. For instance, <b>beginRaw()</b> with the
|
10884
10884
|
* PDF library will write the geometry as flattened triangles and lines,
|
10885
10885
|
* even if recording from the <b>P3D</b> renderer.
|
10886
|
-
*
|
10886
|
+
*
|
10887
10887
|
* If you want a background to show up in your files, use <b>rect(0, 0,
|
10888
10888
|
* width, height)</b> after setting the <b>fill()</b> to the background
|
10889
10889
|
* color. Otherwise the background will not be rendered to the file because
|
10890
10890
|
* the background is not shape.
|
10891
|
-
*
|
10891
|
+
*
|
10892
10892
|
* Using <b>hint(ENABLE_DEPTH_SORT)</b> can improve the appearance of 3D
|
10893
10893
|
* geometry drawn to 2D file formats. See the <b>hint()</b> reference for
|
10894
10894
|
* more details.
|
10895
|
-
*
|
10895
|
+
*
|
10896
10896
|
* See examples in the reference for the <b>PDF</b> and <b>DXF</b>
|
10897
10897
|
* libraries for more information.
|
10898
10898
|
*
|
@@ -11000,7 +11000,7 @@ public class PApplet implements PConstants {
|
|
11000
11000
|
* <b>updatePixels()</b>. Even if the renderer may not seem to use this
|
11001
11001
|
* function in the current Processing release, this will always be subject
|
11002
11002
|
* to change.
|
11003
|
-
*
|
11003
|
+
*
|
11004
11004
|
* Currently, none of the renderers use the additional parameters to
|
11005
11005
|
* <b>updatePixels()</b>, however this may be implemented in the future.
|
11006
11006
|
*
|
@@ -11082,12 +11082,12 @@ public class PApplet implements PConstants {
|
|
11082
11082
|
* specifies a position in 2D and the <b>vertex()</b> function with three
|
11083
11083
|
* parameters specifies a position in 3D. Each shape will be outlined with
|
11084
11084
|
* the current stroke color and filled with the fill color.
|
11085
|
-
*
|
11085
|
+
*
|
11086
11086
|
* Transformations such as <b>translate()</b>, <b>rotate()</b>, and
|
11087
11087
|
* <b>scale()</b> do not work within <b>beginShape()</b>. It is also not
|
11088
11088
|
* possible to use other shapes, such as <b>ellipse()</b> or <b>rect()</b>
|
11089
11089
|
* within <b>beginShape()</b>.
|
11090
|
-
*
|
11090
|
+
*
|
11091
11091
|
* The P3D renderer settings allow <b>stroke()</b> and <b>fill()</b>
|
11092
11092
|
* settings to be altered per-vertex, however the default P2D renderer does
|
11093
11093
|
* not. Settings such as <b>strokeWeight()</b>, <b>strokeCap()</b>, and
|
@@ -11227,7 +11227,7 @@ public class PApplet implements PConstants {
|
|
11227
11227
|
* Sets a texture to be applied to vertex points. The <b>texture()</b>
|
11228
11228
|
* function must be called between <b>beginShape()</b> and
|
11229
11229
|
* <b>endShape()</b> and before any calls to <b>vertex()</b>.
|
11230
|
-
*
|
11230
|
+
*
|
11231
11231
|
* When textures are in use, the fill color is ignored. Instead, use tint()
|
11232
11232
|
* to specify the color of the texture as it is applied to the shape.
|
11233
11233
|
*
|
@@ -11293,10 +11293,10 @@ public class PApplet implements PConstants {
|
|
11293
11293
|
* <b>vertex()</b> is used to specify the vertex coordinates for points,
|
11294
11294
|
* lines, triangles, quads, and polygons and is used exclusively within the
|
11295
11295
|
* <b>beginShape()</b> and <b>endShape()</b> function.
|
11296
|
-
*
|
11296
|
+
*
|
11297
11297
|
* Drawing a vertex in 3D using the <b>z</b> parameter requires the P3D
|
11298
11298
|
* parameter in combination with size as shown in the above example.
|
11299
|
-
*
|
11299
|
+
*
|
11300
11300
|
* This function is also used to map a texture onto the geometry. The
|
11301
11301
|
* <b>texture()</b> function declares the texture to apply to the geometry
|
11302
11302
|
* and the <b>u</b> and <b>v</b> coordinates set define the mapping of this
|
@@ -12451,7 +12451,7 @@ public class PApplet implements PConstants {
|
|
12451
12451
|
* the fourth and fifth parameters to set the opposite corner. Use
|
12452
12452
|
* <b>imageMode(CENTER)</b> to draw images centered at the given x and y
|
12453
12453
|
* position.
|
12454
|
-
*
|
12454
|
+
*
|
12455
12455
|
* The parameter to <b>imageMode()</b> must be written in ALL CAPS because
|
12456
12456
|
* Processing is a case-sensitive language.
|
12457
12457
|
*
|
@@ -12481,12 +12481,12 @@ public class PApplet implements PConstants {
|
|
12481
12481
|
* its upper-left corner. The image is displayed at its original size
|
12482
12482
|
* unless the <b>width</b> and <b>height</b> parameters specify a different
|
12483
12483
|
* size.
|
12484
|
-
*
|
12484
|
+
*
|
12485
12485
|
* The <b>imageMode()</b> function changes the way the parameters work. For
|
12486
12486
|
* example, a call to <b>imageMode(CORNERS)</b> will change the
|
12487
12487
|
* <b>width</b> and <b>height</b> parameters to define the x and y values
|
12488
12488
|
* of the opposite corner of the image.
|
12489
|
-
*
|
12489
|
+
*
|
12490
12490
|
* The color of an image may be modified with the <b>tint()</b> function.
|
12491
12491
|
* This function will maintain transparency for GIF and PNG images.
|
12492
12492
|
*
|
@@ -12587,7 +12587,7 @@ public class PApplet implements PConstants {
|
|
12587
12587
|
* to <b>shapeMode(CORNERS)</b>, for example, will change the width and
|
12588
12588
|
* height parameters to define the x and y values of the opposite corner of
|
12589
12589
|
* the shape.
|
12590
|
-
*
|
12590
|
+
*
|
12591
12591
|
* Note complex shapes may draw awkwardly with P3D. This renderer does not
|
12592
12592
|
* yet support shapes that have holes or complicated breaks.
|
12593
12593
|
*
|
@@ -12634,7 +12634,7 @@ public class PApplet implements PConstants {
|
|
12634
12634
|
* CENTER, and RIGHT set the display characteristics of the letters in
|
12635
12635
|
* relation to the values for the <b>x</b> and <b>y</b> parameters of the
|
12636
12636
|
* <b>text()</b> function.
|
12637
|
-
*
|
12637
|
+
*
|
12638
12638
|
* In Processing 0125 and later, an optional second parameter can be used
|
12639
12639
|
* to vertically align the text. BASELINE is the default, and the vertical
|
12640
12640
|
* alignment will be reset to BASELINE if the second parameter is not used.
|
@@ -12642,12 +12642,12 @@ public class PApplet implements PConstants {
|
|
12642
12642
|
* offsets the line based on the current <b>textDescent()</b>. For multiple
|
12643
12643
|
* lines, the final line will be aligned to the bottom, with the previous
|
12644
12644
|
* lines appearing above it.
|
12645
|
-
*
|
12645
|
+
*
|
12646
12646
|
* When using <b>text()</b> with width and height parameters, BASELINE is
|
12647
12647
|
* ignored, and treated as TOP. (Otherwise, text would by default draw
|
12648
12648
|
* outside the box, since BASELINE is the default setting. BASELINE is not
|
12649
12649
|
* a useful drawing mode for text drawn in a rectangle.)
|
12650
|
-
*
|
12650
|
+
*
|
12651
12651
|
* The vertical alignment is based on the value of <b>textAscent()</b>,
|
12652
12652
|
* which many fonts do not specify correctly. It may be necessary to use a
|
12653
12653
|
* hack and offset by a few pixels by hand so that the offset looks
|
@@ -12720,7 +12720,7 @@ public class PApplet implements PConstants {
|
|
12720
12720
|
* "Create Font..." tool) until it is changed with <b>textSize()</b>.
|
12721
12721
|
* Because fonts are usually bitmaped, you should create fonts at
|
12722
12722
|
* the sizes that will be used most commonly. Using <b>textFont()</b>
|
12723
|
-
* without the size parameter will result in the cleanest-looking text.
|
12723
|
+
* without the size parameter will result in the cleanest-looking text.
|
12724
12724
|
* With the default (JAVA2D) and PDF renderers, it's also possible
|
12725
12725
|
* to enable the use of native fonts via the command
|
12726
12726
|
* <b>hint(ENABLE_NATIVE_FONTS)</b>. This will produce vector text in
|
@@ -12781,7 +12781,7 @@ public class PApplet implements PConstants {
|
|
12781
12781
|
* Sets the way text draws to the screen. In the default configuration, the
|
12782
12782
|
* <b>MODEL</b> mode, it's possible to rotate, scale, and place letters in
|
12783
12783
|
* two and three dimensional space.
|
12784
|
-
*
|
12784
|
+
*
|
12785
12785
|
* The <b>SHAPE</b> mode draws text using the the glyph outlines of
|
12786
12786
|
* individual characters rather than as textures. This mode is only
|
12787
12787
|
* supported with the <b>PDF</b> and <b>P3D</b> renderer settings. With the
|
@@ -12789,7 +12789,7 @@ public class PApplet implements PConstants {
|
|
12789
12789
|
* other drawing occurs. If the outlines are not available, then
|
12790
12790
|
* <b>textMode(SHAPE)</b> will be ignored and <b>textMode(MODEL)</b> will
|
12791
12791
|
* be used instead.
|
12792
|
-
*
|
12792
|
+
*
|
12793
12793
|
* The <b>textMode(SHAPE)</b> option in <b>P3D</b> can be combined with
|
12794
12794
|
* <b>beginRaw()</b> to write vector-accurate text to 2D and 3D output
|
12795
12795
|
* files, for instance <b>DXF</b> or <b>PDF</b>. The <b>SHAPE</b> mode is
|
@@ -12881,7 +12881,7 @@ public class PApplet implements PConstants {
|
|
12881
12881
|
* with the <b>fill()</b> function. The text displays in relation to the
|
12882
12882
|
* <b>textAlign()</b> function, which gives the option to draw to the left,
|
12883
12883
|
* right, and center of the coordinates.
|
12884
|
-
*
|
12884
|
+
*
|
12885
12885
|
* The <b>x2</b> and <b>y2</b> parameters define a rectangular area to
|
12886
12886
|
* display within and may only be used with string data. For text drawn
|
12887
12887
|
* inside a rectangle, the coordinates are interpreted based on the current
|
@@ -12969,11 +12969,11 @@ public class PApplet implements PConstants {
|
|
12969
12969
|
* Draw text in a box that is constrained to a particular size.
|
12970
12970
|
* The current rectMode() determines what the coordinates mean
|
12971
12971
|
* (whether x1/y1/x2/y2 or x/y/w/h).
|
12972
|
-
*
|
12972
|
+
*
|
12973
12973
|
* Note that the x,y coords of the start of the box
|
12974
12974
|
* will align with the *ascent* of the text, not the baseline,
|
12975
12975
|
* as is the case for the other text() functions.
|
12976
|
-
*
|
12976
|
+
*
|
12977
12977
|
* Newlines that are \n (Unix newline or linefeed char, ascii 10)
|
12978
12978
|
* are honored, and \r (carriage return, Windows and Mac OS) are
|
12979
12979
|
* ignored.
|
@@ -13032,7 +13032,7 @@ public class PApplet implements PConstants {
|
|
13032
13032
|
* and later return to what you had. When a new state is started
|
13033
13033
|
* with push(), it builds on the current style and transform
|
13034
13034
|
* information.
|
13035
|
-
*
|
13035
|
+
*
|
13036
13036
|
* <b>push()</b> stores information related to the current
|
13037
13037
|
* transformation state and style settings controlled by the
|
13038
13038
|
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
@@ -13041,7 +13041,7 @@ public class PApplet implements PConstants {
|
|
13041
13041
|
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
13042
13042
|
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
13043
13043
|
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.
|
13044
|
-
*
|
13044
|
+
*
|
13045
13045
|
* The <b>push()</b> and <b>pop()</b> functions were added with
|
13046
13046
|
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
13047
13047
|
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
@@ -13069,8 +13069,8 @@ public class PApplet implements PConstants {
|
|
13069
13069
|
* you to change the style and transformation settings and later
|
13070
13070
|
* return to what you had. When a new state is started with push(),
|
13071
13071
|
* it builds on the current style and transform information.
|
13072
|
-
*
|
13073
|
-
*
|
13072
|
+
*
|
13073
|
+
*
|
13074
13074
|
* <b>push()</b> stores information related to the current
|
13075
13075
|
* transformation state and style settings controlled by the
|
13076
13076
|
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
@@ -13079,7 +13079,7 @@ public class PApplet implements PConstants {
|
|
13079
13079
|
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
13080
13080
|
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
13081
13081
|
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.
|
13082
|
-
*
|
13082
|
+
*
|
13083
13083
|
* The <b>push()</b> and <b>pop()</b> functions were added with
|
13084
13084
|
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
13085
13085
|
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
@@ -13199,7 +13199,7 @@ public class PApplet implements PConstants {
|
|
13199
13199
|
* Rotates a shape the amount specified by the <b>angle</b> parameter.
|
13200
13200
|
* Angles should be specified in radians (values from 0 to TWO_PI) or
|
13201
13201
|
* converted to radians with the <b>radians()</b> function.
|
13202
|
-
*
|
13202
|
+
*
|
13203
13203
|
* Objects are always rotated around their relative position to the origin
|
13204
13204
|
* and positive numbers rotate objects in a clockwise direction.
|
13205
13205
|
* Transformations apply to everything that happens after and subsequent
|
@@ -13207,7 +13207,7 @@ public class PApplet implements PConstants {
|
|
13207
13207
|
* <b>rotate(HALF_PI)</b> and then <b>rotate(HALF_PI)</b> is the same as
|
13208
13208
|
* <b>rotate(PI)</b>. All tranformations are reset when <b>draw()</b>
|
13209
13209
|
* begins again.
|
13210
|
-
*
|
13210
|
+
*
|
13211
13211
|
* Technically, <b>rotate()</b> multiplies the current transformation
|
13212
13212
|
* matrix by a rotation matrix. This function can be further controlled by
|
13213
13213
|
* the <b>pushMatrix()</b> and <b>popMatrix()</b>.
|
@@ -13418,7 +13418,7 @@ public class PApplet implements PConstants {
|
|
13418
13418
|
* <b>shearX(PI/2)</b> and then <b>shearX(PI/2)</b> is the same as
|
13419
13419
|
* <b>shearX(PI)</b>. If <b>shearX()</b> is called within the
|
13420
13420
|
* <b>draw()</b>, the transformation is reset when the loop begins again.
|
13421
|
-
*
|
13421
|
+
*
|
13422
13422
|
* Technically, <b>shearX()</b> multiplies the current transformation
|
13423
13423
|
* matrix by a rotation matrix. This function can be further controlled by
|
13424
13424
|
* the <b>pushMatrix()</b> and <b>popMatrix()</b> functions.
|
@@ -13453,7 +13453,7 @@ public class PApplet implements PConstants {
|
|
13453
13453
|
* <b>shearY(PI/2)</b> and then <b>shearY(PI/2)</b> is the same as
|
13454
13454
|
* <b>shearY(PI)</b>. If <b>shearY()</b> is called within the
|
13455
13455
|
* <b>draw()</b>, the transformation is reset when the loop begins again.
|
13456
|
-
*
|
13456
|
+
*
|
13457
13457
|
* Technically, <b>shearY()</b> multiplies the current transformation
|
13458
13458
|
* matrix by a rotation matrix. This function can be further controlled by
|
13459
13459
|
* the <b>pushMatrix()</b> and <b>popMatrix()</b> functions.
|
@@ -13963,7 +13963,7 @@ public class PApplet implements PConstants {
|
|
13963
13963
|
* transformations (scale, rotate, translate, etc.) The X value can be used
|
13964
13964
|
* to place an object in space relative to the location of the original
|
13965
13965
|
* point once the transformations are no longer in use.
|
13966
|
-
*
|
13966
|
+
*
|
13967
13967
|
* In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
13968
13968
|
* <b>modelZ()</b> functions record the location of a box in space after
|
13969
13969
|
* being placed using a series of translate and rotate commands. After
|
@@ -13993,7 +13993,7 @@ public class PApplet implements PConstants {
|
|
13993
13993
|
* transformations (scale, rotate, translate, etc.) The Y value can be used
|
13994
13994
|
* to place an object in space relative to the location of the original
|
13995
13995
|
* point once the transformations are no longer in use.
|
13996
|
-
*
|
13996
|
+
*
|
13997
13997
|
* In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
13998
13998
|
* <b>modelZ()</b> functions record the location of a box in space after
|
13999
13999
|
* being placed using a series of translate and rotate commands. After
|
@@ -14023,7 +14023,7 @@ public class PApplet implements PConstants {
|
|
14023
14023
|
* transformations (scale, rotate, translate, etc.) The Z value can be used
|
14024
14024
|
* to place an object in space relative to the location of the original
|
14025
14025
|
* point once the transformations are no longer in use.
|
14026
|
-
*
|
14026
|
+
*
|
14027
14027
|
* In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
14028
14028
|
* <b>modelZ()</b> functions record the location of a box in space after
|
14029
14029
|
* being placed using a series of translate and rotate commands. After
|
@@ -14055,7 +14055,7 @@ public class PApplet implements PConstants {
|
|
14055
14055
|
* <b>pushStyle()</b>, it builds on the current style information. The
|
14056
14056
|
* <b>pushStyle()</b> and <b>popStyle()</b> functions can be embedded to
|
14057
14057
|
* provide more control (see the second example above for a demonstration.)
|
14058
|
-
*
|
14058
|
+
*
|
14059
14059
|
* The style information controlled by the following functions are included
|
14060
14060
|
* in the style:
|
14061
14061
|
* fill(), stroke(), tint(), strokeWeight(), strokeCap(), strokeJoin(),
|
@@ -14107,7 +14107,7 @@ public class PApplet implements PConstants {
|
|
14107
14107
|
*
|
14108
14108
|
* Sets the width of the stroke used for lines, points, and the border
|
14109
14109
|
* around shapes. All widths are set in units of pixels.
|
14110
|
-
*
|
14110
|
+
*
|
14111
14111
|
* When drawing with P3D, series of connected lines (such as the stroke
|
14112
14112
|
* around a polygon, triangle, or ellipse) produce unattractive results
|
14113
14113
|
* when a thick stroke weight is set (<a
|
@@ -14138,7 +14138,7 @@ public class PApplet implements PConstants {
|
|
14138
14138
|
* are either mitered, beveled, or rounded and specified with the
|
14139
14139
|
* corresponding parameters MITER, BEVEL, and ROUND. The default joint is
|
14140
14140
|
* MITER.
|
14141
|
-
*
|
14141
|
+
*
|
14142
14142
|
* This function is not available with the P3D renderer, (<a
|
14143
14143
|
* href="http://code.google.com/p/processing/issues/detail?id=123">see
|
14144
14144
|
* Issue 123</a>). More information about the renderers can be found in the
|
@@ -14164,7 +14164,7 @@ public class PApplet implements PConstants {
|
|
14164
14164
|
* Sets the style for rendering line endings. These ends are either
|
14165
14165
|
* squared, extended, or rounded and specified with the corresponding
|
14166
14166
|
* parameters SQUARE, PROJECT, and ROUND. The default cap is ROUND.
|
14167
|
-
*
|
14167
|
+
*
|
14168
14168
|
* This function is not available with the P3D renderer (<a
|
14169
14169
|
* href="http://code.google.com/p/processing/issues/detail?id=123">see
|
14170
14170
|
* Issue 123</a>). More information about the renderers can be found in the
|
@@ -14211,7 +14211,7 @@ public class PApplet implements PConstants {
|
|
14211
14211
|
* is either specified in terms of the RGB or HSB color depending on the
|
14212
14212
|
* current <b>colorMode()</b> (the default color space is RGB, with each
|
14213
14213
|
* value in the range from 0 to 255).
|
14214
|
-
*
|
14214
|
+
*
|
14215
14215
|
* When using hexadecimal notation to specify a color, use "#" or "0x"
|
14216
14216
|
* before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
|
14217
14217
|
* digits to specify a color (the way colors are specified in HTML and
|
@@ -14219,7 +14219,7 @@ public class PApplet implements PConstants {
|
|
14219
14219
|
* hexadecimal value must be specified with eight characters; the first two
|
14220
14220
|
* characters define the alpha component and the remainder the red, green,
|
14221
14221
|
* and blue components.
|
14222
|
-
*
|
14222
|
+
*
|
14223
14223
|
* The value for the parameter "gray" must be less than or equal to the
|
14224
14224
|
* current maximum value as specified by <b>colorMode()</b>. The default
|
14225
14225
|
* maximum value is 255.
|
@@ -14309,12 +14309,12 @@ public class PApplet implements PConstants {
|
|
14309
14309
|
*
|
14310
14310
|
* Sets the fill value for displaying images. Images can be tinted to
|
14311
14311
|
* specified colors or made transparent by setting the alpha.
|
14312
|
-
*
|
14312
|
+
*
|
14313
14313
|
* To make an image transparent, but not change it's color, use white as
|
14314
14314
|
* the tint color and specify an alpha value. For instance, tint(255, 128)
|
14315
14315
|
* will make an image 50% transparent (unless <b>colorMode()</b> has been
|
14316
14316
|
* used).
|
14317
|
-
*
|
14317
|
+
*
|
14318
14318
|
* When using hexadecimal notation to specify a color, use "#" or "0x"
|
14319
14319
|
* before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
|
14320
14320
|
* digits to specify a color (the way colors are specified in HTML and
|
@@ -14322,11 +14322,11 @@ public class PApplet implements PConstants {
|
|
14322
14322
|
* hexadecimal value must be specified with eight characters; the first two
|
14323
14323
|
* characters define the alpha component and the remainder the red, green,
|
14324
14324
|
* and blue components.
|
14325
|
-
*
|
14325
|
+
*
|
14326
14326
|
* The value for the parameter "gray" must be less than or equal to the
|
14327
14327
|
* current maximum value as specified by <b>colorMode()</b>. The default
|
14328
14328
|
* maximum value is 255.
|
14329
|
-
*
|
14329
|
+
*
|
14330
14330
|
* The <b>tint()</b> function is also used to control the coloring of
|
14331
14331
|
* textures in 3D.
|
14332
14332
|
*
|
@@ -14413,7 +14413,7 @@ public class PApplet implements PConstants {
|
|
14413
14413
|
* color is either specified in terms of the RGB or HSB color depending on
|
14414
14414
|
* the current <b>colorMode()</b> (the default color space is RGB, with
|
14415
14415
|
* each value in the range from 0 to 255).
|
14416
|
-
*
|
14416
|
+
*
|
14417
14417
|
* When using hexadecimal notation to specify a color, use "#" or "0x"
|
14418
14418
|
* before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
|
14419
14419
|
* digits to specify a color (the way colors are specified in HTML and
|
@@ -14421,11 +14421,11 @@ public class PApplet implements PConstants {
|
|
14421
14421
|
* hexadecimal value must be specified with eight characters; the first two
|
14422
14422
|
* characters define the alpha component and the remainder the red, green,
|
14423
14423
|
* and blue components.
|
14424
|
-
*
|
14424
|
+
*
|
14425
14425
|
* The value for the parameter "gray" must be less than or equal to the
|
14426
14426
|
* current maximum value as specified by <b>colorMode()</b>. The default
|
14427
14427
|
* maximum value is 255.
|
14428
|
-
*
|
14428
|
+
*
|
14429
14429
|
* To change the color of an image (or a texture), use tint().
|
14430
14430
|
*
|
14431
14431
|
* ( end auto-generated )
|
@@ -14917,13 +14917,13 @@ public class PApplet implements PConstants {
|
|
14917
14917
|
* of the Processing window. The default background is light gray. In the
|
14918
14918
|
* <b>draw()</b> function, the background color is used to clear the
|
14919
14919
|
* display window at the beginning of each frame.
|
14920
|
-
*
|
14920
|
+
*
|
14921
14921
|
* An image can also be used as the background for a sketch, however its
|
14922
14922
|
* width and height must be the same size as the sketch window. To resize
|
14923
14923
|
* an image 'b' to the size of the sketch window, use b.resize(width, height).
|
14924
|
-
*
|
14924
|
+
*
|
14925
14925
|
* Images used as background will ignore the current <b>tint()</b> setting.
|
14926
|
-
*
|
14926
|
+
*
|
14927
14927
|
* It is not possible to use transparency (alpha) in background colors with
|
14928
14928
|
* the main drawing surface, however they will work properly with <b>createGraphics()</b>.
|
14929
14929
|
*
|
@@ -15007,12 +15007,12 @@ public class PApplet implements PConstants {
|
|
15007
15007
|
* Takes an RGB or ARGB image and sets it as the background.
|
15008
15008
|
* The width and height of the image must be the same size as the sketch.
|
15009
15009
|
* Use image.resize(width, height) to make short work of such a task.
|
15010
|
-
*
|
15010
|
+
*
|
15011
15011
|
* Note that even if the image is set as RGB, the high 8 bits of each pixel
|
15012
15012
|
* should be set opaque (0xFF000000) because the image data will be copied
|
15013
15013
|
* directly to the screen, and non-opaque background images may have strange
|
15014
15014
|
* behavior. Use image.filter(OPAQUE) to handle this easily.
|
15015
|
-
*
|
15015
|
+
*
|
15016
15016
|
* When using 3D, this will also clear the zbuffer (if it exists).
|
15017
15017
|
*
|
15018
15018
|
* @param image PImage to set as background (must be same size as the sketch window)
|
@@ -15325,13 +15325,13 @@ public class PApplet implements PConstants {
|
|
15325
15325
|
* <b>height</b> parameter. When getting an image, the <b>x</b> and
|
15326
15326
|
* <b>y</b> parameters define the coordinates for the upper-left corner of
|
15327
15327
|
* the image, regardless of the current <b>imageMode()</b>.
|
15328
|
-
*
|
15328
|
+
*
|
15329
15329
|
* If the pixel requested is outside of the image window, black is
|
15330
15330
|
* returned. The numbers returned are scaled according to the current color
|
15331
15331
|
* ranges, but only RGB values are returned by this function. For example,
|
15332
15332
|
* even though you may have drawn a shape with <b>colorMode(HSB)</b>, the
|
15333
15333
|
* numbers returned will be in RGB format.
|
15334
|
-
*
|
15334
|
+
*
|
15335
15335
|
* Getting the color of a single pixel with <b>get(x, y)</b> is easy, but
|
15336
15336
|
* not as fast as grabbing the data directly from <b>pixels[]</b>. The
|
15337
15337
|
* equivalent statement to <b>get(x, y)</b> using <b>pixels[]</b> is
|
@@ -15399,14 +15399,14 @@ public class PApplet implements PConstants {
|
|
15399
15399
|
*
|
15400
15400
|
* Changes the color of any pixel or writes an image directly into the
|
15401
15401
|
* display window.
|
15402
|
-
*
|
15402
|
+
*
|
15403
15403
|
* The <b>x</b> and <b>y</b> parameters specify the pixel to change and the
|
15404
15404
|
* <b>color</b> parameter specifies the color value. The color parameter is
|
15405
15405
|
* affected by the current color mode (the default is RGB values from 0 to
|
15406
15406
|
* 255). When setting an image, the <b>x</b> and <b>y</b> parameters define
|
15407
15407
|
* the coordinates for the upper-left corner of the image, regardless of
|
15408
15408
|
* the current <b>imageMode()</b>.
|
15409
|
-
*
|
15409
|
+
*
|
15410
15410
|
* Setting the color of a single pixel with <b>set(x, y)</b> is easy, but
|
15411
15411
|
* not as fast as putting the data directly into <b>pixels[]</b>. The
|
15412
15412
|
* equivalent statement to <b>set(x, y, #000000)</b> using <b>pixels[]</b>
|
@@ -15452,7 +15452,7 @@ public class PApplet implements PConstants {
|
|
15452
15452
|
* using it as an alpha channel. This mask image should only contain
|
15453
15453
|
* grayscale data, but only the blue color channel is used. The mask image
|
15454
15454
|
* needs to be the same size as the image to which it is applied.
|
15455
|
-
*
|
15455
|
+
*
|
15456
15456
|
* In addition to using a mask image, an integer array containing the alpha
|
15457
15457
|
* channel data can be specified directly. This method is useful for
|
15458
15458
|
* creating dynamically generated alpha masks. This array must be of the
|
@@ -15500,23 +15500,23 @@ public class PApplet implements PConstants {
|
|
15500
15500
|
* they are above or below the threshold defined by the level parameter.
|
15501
15501
|
* The level must be between 0.0 (black) and 1.0(white). If no level is
|
15502
15502
|
* specified, 0.5 is used.
|
15503
|
-
*
|
15503
|
+
*
|
15504
15504
|
* GRAY - converts any colors in the image to grayscale equivalents
|
15505
|
-
*
|
15505
|
+
*
|
15506
15506
|
* INVERT - sets each pixel to its inverse value
|
15507
|
-
*
|
15507
|
+
*
|
15508
15508
|
* POSTERIZE - limits each channel of the image to the number of colors
|
15509
15509
|
* specified as the level parameter
|
15510
|
-
*
|
15510
|
+
*
|
15511
15511
|
* BLUR - executes a Guassian blur with the level parameter specifying the
|
15512
15512
|
* extent of the blurring. If no level parameter is used, the blur is
|
15513
15513
|
* equivalent to Guassian blur of radius 1
|
15514
|
-
*
|
15514
|
+
*
|
15515
15515
|
* OPAQUE - sets the alpha channel to entirely opaque
|
15516
|
-
*
|
15516
|
+
*
|
15517
15517
|
* ERODE - reduces the light areas with the amount defined by the level
|
15518
15518
|
* parameter
|
15519
|
-
*
|
15519
|
+
*
|
15520
15520
|
* DILATE - increases the light areas with the amount defined by the level parameter
|
15521
15521
|
*
|
15522
15522
|
* ( end auto-generated )
|
@@ -15535,7 +15535,7 @@ public class PApplet implements PConstants {
|
|
15535
15535
|
* </UL>
|
15536
15536
|
* Luminance conversion code contributed by
|
15537
15537
|
* <A HREF="http://www.toxi.co.uk">toxi</A>
|
15538
|
-
*
|
15538
|
+
*
|
15539
15539
|
* Gaussian blur code contributed by
|
15540
15540
|
* <A HREF="http://incubator.quasimondo.com">Mario Klingemann</A>
|
15541
15541
|
*
|
@@ -15559,7 +15559,7 @@ public class PApplet implements PConstants {
|
|
15559
15559
|
* source pixels to fit the specified target region. No alpha information
|
15560
15560
|
* is used in the process, however if the source image has an alpha channel
|
15561
15561
|
* set, it will be copied as well.
|
15562
|
-
*
|
15562
|
+
*
|
15563
15563
|
* As of release 0149, this function ignores <b>imageMode()</b>.
|
15564
15564
|
*
|
15565
15565
|
* ( end auto-generated )
|
@@ -15610,46 +15610,46 @@ public class PApplet implements PConstants {
|
|
15610
15610
|
* parameter. These copies utilize full alpha channel support and a choice
|
15611
15611
|
* of the following modes to blend the colors of source pixels (A) with the
|
15612
15612
|
* ones of pixels in the destination image (B):
|
15613
|
-
*
|
15613
|
+
*
|
15614
15614
|
* BLEND - linear interpolation of colours: C = A*factor + B
|
15615
|
-
*
|
15615
|
+
*
|
15616
15616
|
* ADD - additive blending with white clip: C = min(A*factor + B, 255)
|
15617
|
-
*
|
15617
|
+
*
|
15618
15618
|
* SUBTRACT - subtractive blending with black clip: C = max(B - A*factor,
|
15619
15619
|
* 0)
|
15620
|
-
*
|
15620
|
+
*
|
15621
15621
|
* DARKEST - only the darkest colour succeeds: C = min(A*factor, B)
|
15622
|
-
*
|
15622
|
+
*
|
15623
15623
|
* LIGHTEST - only the lightest colour succeeds: C = max(A*factor, B)
|
15624
|
-
*
|
15624
|
+
*
|
15625
15625
|
* DIFFERENCE - subtract colors from underlying image.
|
15626
|
-
*
|
15626
|
+
*
|
15627
15627
|
* EXCLUSION - similar to DIFFERENCE, but less extreme.
|
15628
|
-
*
|
15628
|
+
*
|
15629
15629
|
* MULTIPLY - Multiply the colors, result will always be darker.
|
15630
|
-
*
|
15630
|
+
*
|
15631
15631
|
* SCREEN - Opposite multiply, uses inverse values of the colors.
|
15632
|
-
*
|
15632
|
+
*
|
15633
15633
|
* OVERLAY - A mix of MULTIPLY and SCREEN. Multiplies dark values,
|
15634
15634
|
* and screens light values.
|
15635
|
-
*
|
15635
|
+
*
|
15636
15636
|
* HARD_LIGHT - SCREEN when greater than 50% gray, MULTIPLY when lower.
|
15637
|
-
*
|
15637
|
+
*
|
15638
15638
|
* SOFT_LIGHT - Mix of DARKEST and LIGHTEST.
|
15639
15639
|
* Works like OVERLAY, but not as harsh.
|
15640
|
-
*
|
15640
|
+
*
|
15641
15641
|
* DODGE - Lightens light tones and increases contrast, ignores darks.
|
15642
15642
|
* Called "Color Dodge" in Illustrator and Photoshop.
|
15643
|
-
*
|
15643
|
+
*
|
15644
15644
|
* BURN - Darker areas are applied, increasing contrast, ignores lights.
|
15645
15645
|
* Called "Color Burn" in Illustrator and Photoshop.
|
15646
|
-
*
|
15646
|
+
*
|
15647
15647
|
* All modes use the alpha information (highest byte) of source image
|
15648
15648
|
* pixels as the blending factor. If the source and destination regions are
|
15649
15649
|
* different sizes, the image will be automatically resized to match the
|
15650
15650
|
* destination size. If the <b>srcImg</b> parameter is not used, the
|
15651
15651
|
* display window is used as the source image.
|
15652
|
-
*
|
15652
|
+
*
|
15653
15653
|
* As of release 0149, this function ignores <b>imageMode()</b>.
|
15654
15654
|
*
|
15655
15655
|
* ( end auto-generated )
|