-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy paththis.xml
More file actions
executable file
·78 lines (57 loc) · 1.82 KB
/
Copy paththis.xml
File metadata and controls
executable file
·78 lines (57 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>this</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web & Application</usage>
<example>
<image></image>
<code><![CDATA[
float ypos = 50;
void setup() {
size(100, 100);
noLoop();
}
void draw() {
line(0, 0, 100, ypos);
// "this" references the Processing sketch,
// and is not necessary in this case
this.ypos = 100;
line(0, 0, 100, ypos);
}
]]></code>
</example>
<example>
<image></image>
<code><![CDATA[
import processing.video.*;
Movie myMovie;
void setup() {
size(200, 200);
background(0);
// "this" references the Processing sketch
myMovie = new Movie(this, "totoro.mov");
myMovie.loop();
}
void draw() {
if (myMovie.available()) {
myMovie.read();
}
image(myMovie, 0, 0);
}
]]></code>
</example>
<description><![CDATA[
Refers to the current object (i.e., "this object"), which will change depending on the context in which <b>this</b> is referenced. In Processing, it's most common to use <b>this</b> to pass a reference from the current object into one of the libraries.<br />
<br />
The keyword <b>this</b> can also be used to reference an object's own method from within itself, but such usage is typically not necessary. For example, if you are calling the <b>filter()</b> method of a <b>PImage</b> object named <b>tree</b> from another object, you would write <b>tree.filter()</b>. To call this method inside the PImage object itself, one could simply write <b>filter()</b> or, more explicitly, <b>this.filter()</b>. The additional level of specificity in <b>this.filter()</b> is not necessary, as it is always implied.
]]></description>
<syntax></syntax>
<returns></returns>
<related>
</related>
<availability>1.0</availability>
<type>Keyword</type>
<partof>PDE</partof>
<level>extended</level>
</root>