forked from processing-js/processing-js.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPGraphics.html
More file actions
94 lines (80 loc) · 2.47 KB
/
Copy pathPGraphics.html
File metadata and controls
94 lines (80 loc) · 2.47 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
layout: default
---
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr class="name-row">
<th scope="row">Name</th>
<td><h3>PGraphics</h3></td>
</tr>
<tr class="">
<th scope="row">Examples</th>
<td><div class="example"><img src="/reference/pgraphics.jpg" alt="example pic" /><pre class="margin">PGraphics pg;
void setup() {
size(100, 100);
pg = createGraphics(80, 80, P3D);
}
void draw() {
pg.beginDraw();
pg.background(102);
pg.stroke(255);
pg.line(40, 40, mouseX, mouseY);
pg.endDraw();
image(pg, 10, 10);
}</pre></div></td>
</tr>
<tr class="">
<th scope="row">Description</th>
<td><p>Main graphics and rendering context, as well as the base API implementation for processing "core".
Use this class if you need to draw into an off-screen graphics buffer. A PGraphics object can be constructed with the <b>createGraphics()</b> function.
The <b>beginDraw()</b> and <b>endDraw()</b> methods (see above example) are necessary to set up the buffer and to finalize it.
The fields and methods for this class are extensive; for a complete list visit the developer's reference: http://dev.processing.org/reference/core/</p></td>
</tr>
<tr class="">
<th scope="row">Methods</th>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr class="">
<th scope="row"><a href="../reference/PGraphics_beginDraw_">beginDraw()</a></th>
<td>Sets up the rendering context</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PGraphics_endDraw_">endDraw()</a></th>
<td>Finalizes the renderering context</td>
</tr>
</table>
</td>
</tr>
<tr class="">
<th scope="row"><!--*-->Constructor<!--*--></th>
<td><pre>PGraphics()</pre><br />
<pre>PGraphics(<kbd>width</kbd>,<kbd>height</kbd>)</pre><br />
<pre>PGraphics(<kbd>width</kbd>,<kbd>height</kbd>,<kbd>applet</kbd>)</pre><br /></td>
</tr>
<tr class="">
<th scope="row">Parameters</th>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr class="">
<th scope="row">width</th>
<td>int: width in pixels</td>
</tr>
<tr class="">
<th scope="row">height</th>
<td>int: height in pixels</td>
</tr>
<tr class="">
<th scope="row">applet</th>
<td>PApplet</td>
</tr>
</table>
</td>
</tr>
<tr class="">
<th scope="row">Usage</th>
<td>Web & Application</td>
</tr>
<tr class="">
<th scope="row">Related</th>
<td><a href="../reference/createGraphics_">createGraphics()</a></td>
</tr>
</table>