Skip to content

Commit 19b3955

Browse files
committed
Updated helpfile
1 parent 9e2b478 commit 19b3955

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pdlua-help.pd

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#N canvas 467 36 561 528 10;
1+
#N canvas 466 36 565 577 10;
22
#X declare -lib pdlua -path pdlua;
33
#X declare -path pdlua/examples;
44
#X text 16 358 See also:;
@@ -174,19 +174,16 @@
174174
#X connect 111 0 65 0;
175175
#X connect 112 0 67 0;
176176
#X restore 446 359 pd quickstart;
177-
#N canvas 0 22 450 300 graphics 1;
177+
#N canvas 121 146 669 774 graphics 1;
178178
#X obj 8 77 hello-gui;
179179
#X text 8 323 You can enable GUI mode by setting the self.gui variable in the constructor \, like this:;
180180
#X text 8 366 function yourclass:initialize(sel \, atoms);
181181
#X text 25 383 self.gui = 1;
182-
#X text 25 400 return true;
183-
#X text 8 418 end;
182+
#X text 24 415 return true;
183+
#X text 7 433 end;
184184
#X text 8 457 -------------- Painting: --------------;
185185
#X text 8 480 You can paint by defining the "paint" function \, for example:;
186186
#X text 8 561 end;
187-
#X text 8 509 function yourclass:paint();
188-
#X text 25 526 gfx.set_color(250 \, 200 \, 240);
189-
#X text 25 543 gfx.fill_all();
190187
#X text 8 604 -------------- Mouse Events: --------------;
191188
#X text 8 633 You can receive mouse events by defining the "mouse_down" \, "mouse_up" \, "mouse_move" and "mouse_drag" functions. Both pass the x \, y coordinates as arguments. For example:;
192189
#X text 8 743 end;
@@ -197,6 +194,10 @@
197194
#X text 8 788 -------------- API: --------------;
198195
#X text 356 816 -- Paint callback. This is the only place where you're allowed to call any of the paint functions \; \; -- Mouse down callback \, called when the mouse is clicked \; -- Mouse up callback \, called when the mouse button is released \; -- Mouse move callback \, called when the mouse is moved while not being down \; -- Mouse drag callback \, called when the mouse is moved while also being down \; \; \; \; -- Request a repaint \, after this the "paint" callback will occur \; \; -- Sets the size of the drawing object. \; -- Sets the color for the next drawing operation. \; \; -- Draws a filled ellipse at the specified position and size. \; -- Draws the outline of an ellipse at the specified position and size. \; -- Draws a filled rectangle at the specified position and size. \; -- Draws the outline of a rectangle at the specified position and size. \; -- Draws a filled rounded rectangle at the specified position and size. \; -- Draws the outline of a rounded rectangle at the specified position and size. \; \; -- Draws a line between two points. \; -- Draws text at the specified position and size. \; \; -- Initiates a new path at the specified point. \; -- Adds a line segment to the current path. \; -- Adds a quadratic Bezier curve to the current path. \; -- Adds a cubic Bezier curve to the current path. \; -- Closes the current path. \; -- Draws the outline of the current path with the specified line width. \; -- Fills the current path. \; \; -- Fills the entire drawing area with the current color. Also will draw an object outline in the style of the host (ie. pure-data or plugdata) \; \; -- Translates the coordinate system by the specified amounts. \; -- Scales the coordinate system by the specified factors. This will always happen after the translation \; -- Resets current scale and translation \;, f 134;
199196
#X text 8 816 paint() \; \; pd:Class:mouse_down(x \, y) \; pd:Class:mouse_up(x \, y) \; pd:Class:mouse_move(x \, y) \; pd:Class:mouse_drag(x \, y) \; \; -- Functions you can call \; \; pd:Class:repaint() \; \; gfx.set_size(w \, h) \; gfx.set_color(r \, g \, b \, a=1.0) \; \; gfx.fill_ellipse(x \, y \, w \, h) \; gfx.stroke_ellipse(x \, y \, w \, h \, line_width) \; gfx.fill_rect(x \, y \, w \, h) \; gfx.stroke_rect(x \, y \, w \, h \, line_width) \; gfx.fill_rounded_rect(x \, y \, w \, h \, corner_radius) \; gfx.stroke_rounded_rect(x \, y \, w \, h \, corner_radius \, line_width) \; \; gfx.draw_line(x1 \, y1 \, x2 \, y2) \; gfx.draw_text(text \, x \, y \, w \, fontsize) \; \; gfx.start_path(x \, y) \; gfx.line_to(x \, y) \; gfx.quad_to(x1 \, y1 \, x2 \, y2) \; gfx.cubic_to(x1 \, y1 \, x2 \, y2 \, x3 \, y) \; gfx.close_path() \; gfx.stroke_path(line_width) \; gfx.fill_path() \; \; gfx.fill_all() \; \; gfx.translate(tx \, ty) \; gfx.scale(sx \, sy) \; gfx.reset_transform() \;, f 58;
197+
#X text 8 509 function yourclass:paint(g);
198+
#X text 25 526 g.set_color(250 \, 200 \, 240);
199+
#X text 25 543 g.fill_all();
200+
#X text 23 400 self.set_size(100 \, 100);
200201
#X restore 446 409 pd graphics;
201202
#X text 324 384 Details on how to create GUI objects ------->, f 18;
202203
#X obj 342 227 hello;

0 commit comments

Comments
 (0)