|
11334 | 11334 | {
|
11335 | 11335 | "file": "src/dom/dom.js",
|
11336 | 11336 | "line": 1159,
|
11337 |
| - "description": "<p>Creates a dropdown menu <code><select></select></code> element.</p>\n<p>The parameter is optional. If <code>true</code> is passed, as in\n<code>let mySelect = createSelect(true)</code>, then the dropdown will support\nmultiple selections. If an existing <code><select></select></code> element\nis passed, as in <code>let mySelect = createSelect(otherSelect)</code>, the existing\nelement will be wrapped in a new <a href=\"#/p5.Element\">p5.Element</a>\nobject.</p>\n<p>Dropdowns extend the <a href=\"#/p5.Element\">p5.Element</a> class with a few\nhelpful methods for managing options:</p>\n<ul>\n<li><code>mySelect.option(name, [value])</code> adds an option to the menu. The first paremeter, <code>name</code>, is a string that sets the option's name and value. The second parameter, <code>value</code>, is optional. If provided, it sets the value that corresponds to the key <code>name</code>. If an option with <code>name</code> already exists, its value is changed to <code>value</code>.</li>\n<li><code>mySelect.value()</code> returns the currently-selected option's value.</li>\n<li><code>mySelect.selected()</code> returns the currently-selected option.</li>\n<li><code>mySelect.selected(option)</code> selects the given option by default.</li>\n<li><code>mySelect.disable()</code> marks the whole dropdown element as disabled.</li>\n<li><code>mySelect.disable(option)</code> marks a given option as disabled.</li>\n<li><code>mySelect.enable()</code> marks the whole dropdown element as enabled.</li>\n<li><code>mySelect.enable(option)</code> marks a given option as enabled.</li>\n</ul>\n", |
| 11337 | + "description": "<p>Creates a dropdown menu <code><select></select></code> element.</p>\n<p>The parameter is optional. If <code>true</code> is passed, as in\n<code>let mySelect = createSelect(true)</code>, then the dropdown will support\nmultiple selections. If an existing <code><select></select></code> element\nis passed, as in <code>let mySelect = createSelect(otherSelect)</code>, the existing\nelement will be wrapped in a new <a href=\"#/p5.Element\">p5.Element</a>\nobject.</p>\n<p>Dropdowns extend the <a href=\"#/p5.Element\">p5.Element</a> class with a few\nhelpful methods for managing options:</p>\n<ul>\n<li><code>mySelect.option(name, [value])</code> adds an option to the menu. The first parameter, <code>name</code>, is a string that sets the option's name and value. The second parameter, <code>value</code>, is optional. If provided, it sets the value that corresponds to the key <code>name</code>. If an option with <code>name</code> already exists, its value is changed to <code>value</code>.</li>\n<li><code>mySelect.value()</code> returns the currently-selected option's value.</li>\n<li><code>mySelect.selected()</code> returns the currently-selected option.</li>\n<li><code>mySelect.selected(option)</code> selects the given option by default.</li>\n<li><code>mySelect.disable()</code> marks the whole dropdown element as disabled.</li>\n<li><code>mySelect.disable(option)</code> marks a given option as disabled.</li>\n<li><code>mySelect.enable()</code> marks the whole dropdown element as enabled.</li>\n<li><code>mySelect.enable(option)</code> marks a given option as enabled.</li>\n</ul>\n", |
11338 | 11338 | "itemtype": "method",
|
11339 | 11339 | "name": "createSelect",
|
11340 | 11340 | "return": {
|
|
11382 | 11382 | {
|
11383 | 11383 | "file": "src/dom/dom.js",
|
11384 | 11384 | "line": 1440,
|
11385 |
| - "description": "<p>Creates a radio button element.</p>\n<p>The parameter is optional. If a string is passed, as in\n<code>let myRadio = createSelect('food')</code>, then each radio option will\nhave <code>\"food\"</code> as its <code>name</code> parameter: <code><input name=\"food\"></input></code>.\nIf an existing <code><div></div></code> or <code><span></span></code>\nelement is passed, as in <code>let myRadio = createSelect(container)</code>, it will\nbecome the radio button's parent element.</p>\n<p>Radio buttons extend the <a href=\"#/p5.Element\">p5.Element</a> class with a few\nhelpful methods for managing options:</p>\n<ul>\n<li><code>myRadio.option(value, [label])</code> adds an option to the menu. The first paremeter, <code>value</code>, is a string that sets the option's value and label. The second parameter, <code>label</code>, is optional. If provided, it sets the label displayed for the <code>value</code>. If an option with <code>value</code> already exists, its label is changed and its value is returned.</li>\n<li><code>myRadio.value()</code> returns the currently-selected option's value.</li>\n<li><code>myRadio.selected()</code> returns the currently-selected option.</li>\n<li><code>myRadio.selected(value)</code> selects the given option and returns it as an <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement\" target=\"_blank\"><code>HTMLInputElement</code></a>.</li>\n<li><code>myRadio.disable(shouldDisable)</code> enables the entire radio button if <code>true</code> is passed and disables it if <code>false</code> is passed.</li>\n</ul>\n", |
| 11385 | + "description": "<p>Creates a radio button element.</p>\n<p>The parameter is optional. If a string is passed, as in\n<code>let myRadio = createSelect('food')</code>, then each radio option will\nhave <code>\"food\"</code> as its <code>name</code> parameter: <code><input name=\"food\"></input></code>.\nIf an existing <code><div></div></code> or <code><span></span></code>\nelement is passed, as in <code>let myRadio = createSelect(container)</code>, it will\nbecome the radio button's parent element.</p>\n<p>Radio buttons extend the <a href=\"#/p5.Element\">p5.Element</a> class with a few\nhelpful methods for managing options:</p>\n<ul>\n<li><code>myRadio.option(value, [label])</code> adds an option to the menu. The first parameter, <code>value</code>, is a string that sets the option's value and label. The second parameter, <code>label</code>, is optional. If provided, it sets the label displayed for the <code>value</code>. If an option with <code>value</code> already exists, its label is changed and its value is returned.</li>\n<li><code>myRadio.value()</code> returns the currently-selected option's value.</li>\n<li><code>myRadio.selected()</code> returns the currently-selected option.</li>\n<li><code>myRadio.selected(value)</code> selects the given option and returns it as an <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement\" target=\"_blank\"><code>HTMLInputElement</code></a>.</li>\n<li><code>myRadio.disable(shouldDisable)</code> enables the entire radio button if <code>true</code> is passed and disables it if <code>false</code> is passed.</li>\n</ul>\n", |
11386 | 11386 | "itemtype": "method",
|
11387 | 11387 | "name": "createRadio",
|
11388 | 11388 | "return": {
|
|
13775 | 13775 | {
|
13776 | 13776 | "file": "src/image/loading_displaying.js",
|
13777 | 13777 | "line": 888,
|
13778 |
| - "description": "<p>Draws an image to the canvas.</p>\n<p>The first parameter, <code>img</code>, is the source image to be drawn. <code>img</code> can be\nany of the following objects:</p>\n<ul>\n<li><a href=\"#/p5.Image\">p5.Image</a></li>\n<li><a href=\"#/p5.Element\">p5.Element</a></li>\n<li><a href=\"#/p5.Texture\">p5.Texture</a></li>\n<li><a href=\"#/p5.Framebuffer\">p5.Framebuffer</a></li>\n<li><a href=\"#/p5.FramebufferTexture\">p5.FramebufferTexture</a></li>\n</ul>\n<p>The second and third parameters, <code>dx</code> and <code>dy</code>, set the coordinates of the\ndestination image's top left corner. See\n<a href=\"#/p5/imageMode\">imageMode()</a> for other ways to position images.</p>\n<p>Here's a diagram that explains how optional parameters work in <code>image()</code>:</p>\n<p><img src=\"assets/drawImage.png\"></img></p>\n<p>The fourth and fifth parameters, <code>dw</code> and <code>dh</code>, are optional. They set the\nthe width and height to draw the destination image. By default, <code>image()</code>\ndraws the full source image at its original size.</p>\n<p>The sixth and seventh parameters, <code>sx</code> and <code>sy</code>, are also optional.\nThese coordinates define the top left corner of a subsection to draw from\nthe source image.</p>\n<p>The eighth and ninth parameters, <code>sw</code> and <code>sh</code>, are also optional.\nThey define the width and height of a subsection to draw from the source\nimage. By default, <code>image()</code> draws the full subsection that begins at\n<code>(sx, sy)</code> and extends to the edges of the source image.</p>\n<p>The ninth parameter, <code>fit</code>, is also optional. It enables a subsection of\nthe source image to be drawn without affecting its aspect ratio. If\n<code>CONTAIN</code> is passed, the full subsection will appear within the destination\nrectangle. If <code>COVER</code> is passed, the subsection will completely cover the\ndestination rectangle. This may have the effect of zooming into the\nsubsection.</p>\n<p>The tenth and eleventh paremeters, <code>xAlign</code> and <code>yAlign</code>, are also\noptional. They determine how to align the fitted subsection. <code>xAlign</code> can\nbe set to either <code>LEFT</code>, <code>RIGHT</code>, or <code>CENTER</code>. <code>yAlign</code> can be set to\neither <code>TOP</code>, <code>BOTTOM</code>, or <code>CENTER</code>. By default, both <code>xAlign</code> and <code>yAlign</code>\nare set to <code>CENTER</code>.</p>\n", |
| 13778 | + "description": "<p>Draws an image to the canvas.</p>\n<p>The first parameter, <code>img</code>, is the source image to be drawn. <code>img</code> can be\nany of the following objects:</p>\n<ul>\n<li><a href=\"#/p5.Image\">p5.Image</a></li>\n<li><a href=\"#/p5.Element\">p5.Element</a></li>\n<li><a href=\"#/p5.Texture\">p5.Texture</a></li>\n<li><a href=\"#/p5.Framebuffer\">p5.Framebuffer</a></li>\n<li><a href=\"#/p5.FramebufferTexture\">p5.FramebufferTexture</a></li>\n</ul>\n<p>The second and third parameters, <code>dx</code> and <code>dy</code>, set the coordinates of the\ndestination image's top left corner. See\n<a href=\"#/p5/imageMode\">imageMode()</a> for other ways to position images.</p>\n<p>Here's a diagram that explains how optional parameters work in <code>image()</code>:</p>\n<p><img src=\"assets/drawImage.png\"></img></p>\n<p>The fourth and fifth parameters, <code>dw</code> and <code>dh</code>, are optional. They set the\nthe width and height to draw the destination image. By default, <code>image()</code>\ndraws the full source image at its original size.</p>\n<p>The sixth and seventh parameters, <code>sx</code> and <code>sy</code>, are also optional.\nThese coordinates define the top left corner of a subsection to draw from\nthe source image.</p>\n<p>The eighth and ninth parameters, <code>sw</code> and <code>sh</code>, are also optional.\nThey define the width and height of a subsection to draw from the source\nimage. By default, <code>image()</code> draws the full subsection that begins at\n<code>(sx, sy)</code> and extends to the edges of the source image.</p>\n<p>The ninth parameter, <code>fit</code>, is also optional. It enables a subsection of\nthe source image to be drawn without affecting its aspect ratio. If\n<code>CONTAIN</code> is passed, the full subsection will appear within the destination\nrectangle. If <code>COVER</code> is passed, the subsection will completely cover the\ndestination rectangle. This may have the effect of zooming into the\nsubsection.</p>\n<p>The tenth and eleventh parameters, <code>xAlign</code> and <code>yAlign</code>, are also\noptional. They determine how to align the fitted subsection. <code>xAlign</code> can\nbe set to either <code>LEFT</code>, <code>RIGHT</code>, or <code>CENTER</code>. <code>yAlign</code> can be set to\neither <code>TOP</code>, <code>BOTTOM</code>, or <code>CENTER</code>. By default, both <code>xAlign</code> and <code>yAlign</code>\nare set to <code>CENTER</code>.</p>\n", |
13779 | 13779 | "itemtype": "method",
|
13780 | 13780 | "name": "image",
|
13781 | 13781 | "example": [
|
|
0 commit comments