-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
Copy pathmethod.example.js
94 lines (91 loc) · 2.65 KB
/
method.example.js
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
/**
* "This is a template for inline documentation of a method. Remove all text
* between double quotes for using this template. Some description about the
* method goes here. Explain in simple words, what the function does and what
* would be good/bad use cases for it. If there are any corner cases or warnings,
* do explain them over here."
*
* By default, the background is transparent.
*
* @method "methodName"
* @param {dataType} "variableName" "Description of the parameter"
* @param {dataType} ["variableName"] "Description of optional parameter"
* @chainable
*
* @example
* <div>
* <code>
* // "Comment explaining the example."
* "Your code goes here."
* </code>
* </div>
*
* <div>
* <code>
* // "Comment explaining the example."
* "Your code goes here"
* </code>
* </div>
*
* @alt
* "A single line precisely describing the first example"
* "A single line precisely describing the second example"
*/
// "If your method has more than one signature, they can be documented each
// in their own block with description of their parameters as follows."
/**
* @method "methodName"
* @param {"dataType"} "paramName" "Description of the param"
* @param {"dataType"} "paramName" "Description of the param"
* @chainable
*/
p5.prototype.methodName = function() {
// Comment explaining the code.
'Your code goes here';
};
// Here's a filled example for this template.
/**
* The <a href="#/p5/background">background()</a> function sets the color used
* for the background of the p5.js canvas. This function is typically used within
* draw() to clear the display window at the beginning of each frame, but it can
* be used inside setup() to set the background on the first frame of animation
* or if the background need only be set once.
*
* By default, the background is transparent.
*
* @method background
* @param {Number} gray specifies a value between white and black
* @param {Number} [a] opacity of the background relative to current color
* range (default is 0-255)
* @chainable
*
* @example
* <div>
* <code>
* // Grayscale integer value
* background(0);
* </code>
* </div>
*
* <div>
* <code>
* // R, G & B integer values
* background(0,255,0);
* </code>
* </div>
*
* @alt
* A canvas with a black background.
* A canvas with a green background.
*/
/**
* @method background
* @param {String} colorString Color in string datatype, possible formats
* include: integer, rgb(), rgba(), percentage rgb(),
* percentage rgba(), 3 digit hex, 6 digit hex,
* @param {Number} [a]
* @chainable
*/
p5.prototype.background = function() {
// Your code goes here.
};