Skip to content

Commit 85d6ccc

Browse files
committed
updated inline jsdocs for all setters that have them
1 parent 19c6851 commit 85d6ccc

6 files changed

Lines changed: 51 additions & 0 deletions

File tree

src/color/setting.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,6 +1777,8 @@ function setting(p5, fn){
17771777
* EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT,
17781778
* SOFT_LIGHT, DODGE, BURN, ADD, REMOVE or SUBTRACT
17791779
*
1780+
* Calling `blendMode()` without an argument returns the current blendMode.
1781+
*
17801782
* @example
17811783
* function setup() {
17821784
* createCanvas(100, 100);
@@ -2145,6 +2147,10 @@ function setting(p5, fn){
21452147
* describe('A yellow line and a turquoise line form an X on a gray background. The area where they overlap is green.');
21462148
* }
21472149
*/
2150+
/**
2151+
* @method blendMode
2152+
* @return {(BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD_LIGHT|SOFT_LIGHT|DODGE|BURN|ADD|REMOVE|SUBTRACT)} the current blend mode.
2153+
*/
21482154
fn.blendMode = function (mode) {
21492155
// p5._validateParameters('blendMode', arguments);
21502156
if (mode === constants.NORMAL) {

src/core/environment.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ function environment(p5, fn, lifecycles){
215215
* cursor, `x` and `y` set the location pointed to within the image. They are
216216
* both 0 by default, so the cursor points to the image's top-left corner. `x`
217217
* and `y` must be less than the image's width and height, respectively.
218+
*
219+
* Calling `cursor()` without an argument returns the current cursor type as a string.
218220
*
219221
* @method cursor
220222
* @param {(ARROW|CROSS|HAND|MOVE|TEXT|WAIT|String)} type Built-in: either ARROW, CROSS, HAND, MOVE, TEXT, or WAIT.
@@ -281,6 +283,10 @@ function environment(p5, fn, lifecycles){
281283
* }
282284
* }
283285
*/
286+
/**
287+
* @method cursor
288+
* @return {(ARROW|CROSS|HAND|MOVE|TEXT|WAIT|String)} the current cursor type
289+
*/
284290
fn.cursor = function(type, x, y) {
285291
let cursor = 'auto';
286292
const canvas = this._curElement.elt;

src/image/loading_displaying.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,8 @@ function loadingDisplaying(p5, fn){
13251325
* <a href="#/p5/image">image()</a> as the x- and y-coordinates of the image's
13261326
* center. The next parameters are its width and height.
13271327
*
1328+
* Calling `imageMode()` without an argument returns the current image mode, either `CORNER`, `CORNERS`, or `CENTER`.
1329+
*
13281330
* @method imageMode
13291331
* @param {(CORNER|CORNERS|CENTER)} mode either CORNER, CORNERS, or CENTER.
13301332
*
@@ -1388,6 +1390,10 @@ function loadingDisplaying(p5, fn){
13881390
* describe('A square image of a brick wall is drawn on a gray square.');
13891391
* }
13901392
*/
1393+
/**
1394+
* @method imageMode
1395+
* @return {(CORNER|CORNERS|CENTER)} the current image mode
1396+
*/
13911397
fn.imageMode = function(m) {
13921398
// p5._validateParameters('imageMode', arguments);
13931399
if (typeof m === 'undefined') { // getter

src/shape/attributes.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ function attributes(p5, fn){
3535
* the constants `CENTER`, `RADIUS`, `CORNER`, and `CORNERS` are defined this
3636
* way. JavaScript is a case-sensitive language.
3737
*
38+
* Calling `ellipseMode()` without an argument returns the current ellipseMode, either `CENTER`, `RADIUS`, `CORNER`, or `CORNERS`.
39+
*
3840
* @method ellipseMode
3941
* @param {(CENTER|RADIUS|CORNER|CORNERS)} mode either CENTER, RADIUS, CORNER, or CORNERS
4042
* @chainable
@@ -77,6 +79,10 @@ function attributes(p5, fn){
7779
* describe('A white circle with a gray circle at its top-left corner. Both circles have black outlines.');
7880
* }
7981
*/
82+
/**
83+
* @method ellipseMode
84+
* @return {(CENTER|RADIUS|CORNER|CORNERS)} the current ellipseMode.
85+
*/
8086
fn.ellipseMode = function(m) {
8187
// p5._validateParameters('ellipseMode', arguments);
8288
if (typeof m === 'undefined') { // getter
@@ -416,6 +422,8 @@ function attributes(p5, fn){
416422
* the constants `MITER`, `BEVEL`, and `ROUND` are defined this way.
417423
* JavaScript is a case-sensitive language.
418424
*
425+
* Calling `strokeJoin()` without an argument returns the current stroke join style, either `MITER`, `BEVEL`, or `ROUND`.
426+
*
419427
* @method strokeJoin
420428
* @param {(MITER|BEVEL|ROUND)} join either MITER, BEVEL, or ROUND
421429
* @chainable
@@ -482,6 +490,10 @@ function attributes(p5, fn){
482490
* describe('A right-facing arrowhead shape with a rounded tip in center of canvas.');
483491
* }
484492
*/
493+
/**
494+
* @method strokeJoin
495+
* @return {(MITER|BEVEL|ROUND)} the current stroke join style.
496+
*/
485497
fn.strokeJoin = function(join) {
486498
// p5._validateParameters('strokeJoin', arguments);
487499
if (typeof join === 'undefined') { // getter
@@ -503,6 +515,8 @@ function attributes(p5, fn){
503515
*
504516
* Note: `strokeWeight()` is affected by transformations, especially calls to
505517
* <a href="#/p5/scale">scale()</a>.
518+
*
519+
* Calling `strokeWeight()` without an argument returns the current stroke weight as a number.
506520
*
507521
* @method strokeWeight
508522
* @param {Number} weight the weight of the stroke (in pixels).
@@ -545,6 +559,10 @@ function attributes(p5, fn){
545559
* describe('Two horizontal black lines. The top line is thin and the bottom is five times thicker than the top.');
546560
* }
547561
*/
562+
/**
563+
* @method strokeWeight
564+
* @return {Number} the current stroke weight.
565+
*/
548566
fn.strokeWeight = function(w) {
549567
// p5._validateParameters('strokeWeight', arguments);
550568
return this._renderer.strokeWeight(w);

src/shape/custom_shapes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,8 @@ function customShapes(p5, fn) {
16111611
* Note: `bezierVertex()` won’t work when an argument is passed to
16121612
* <a href="#/p5/beginShape">beginShape()</a>.
16131613
*
1614+
* Calling `bezierOrder()` without an argument returns the current Bézier order.
1615+
*
16141616
* @method bezierOrder
16151617
* @param {Number} order The new order to set. Can be either 2 or 3, by default 3
16161618
*

src/webgl/material.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2652,6 +2652,8 @@ function material(p5, fn) {
26522652
*
26532653
* Note: `textureMode()` can only be used in WebGL mode.
26542654
*
2655+
* Calling `textureMode()` with no arguments returns the current texture mode.
2656+
*
26552657
* @method textureMode
26562658
* @param {(IMAGE|NORMAL)} mode either IMAGE or NORMAL.
26572659
*
@@ -2714,6 +2716,10 @@ function material(p5, fn) {
27142716
* endShape();
27152717
* }
27162718
*/
2719+
/**
2720+
* @method textureMode
2721+
* @return {(IMAGE|NORMAL)} The current texture mode, either IMAGE or NORMAL.
2722+
*/
27172723
fn.textureMode = function (mode) {
27182724
if (typeof mode === 'undefined') { // getter
27192725
return this._renderer.states.textureMode;
@@ -2825,6 +2831,9 @@ function material(p5, fn) {
28252831
*
28262832
* Note: `textureWrap()` can only be used in WebGL mode.
28272833
*
2834+
* Calling `textureWrap()` with no arguments returns an object with the current
2835+
* mode for x and y directions, as in `{ wrapX: CLAMP, wrapY: REPEAT }`.
2836+
*
28282837
* @method textureWrap
28292838
* @param {(CLAMP|REPEAT|MIRROR)} wrapX either CLAMP, REPEAT, or MIRROR
28302839
* @param {(CLAMP|REPEAT|MIRROR)} [wrapY=wrapX] either CLAMP, REPEAT, or MIRROR
@@ -2980,6 +2989,10 @@ function material(p5, fn) {
29802989
* endShape();
29812990
* }
29822991
*/
2992+
/**
2993+
* @method textureWrap
2994+
* @return {{x: (CLAMP|REPEAT|MIRROR), y: (CLAMP|REPEAT|MIRROR)}} The current texture wrapping for x and y.
2995+
*/
29832996
fn.textureWrap = function (wrapX, wrapY = wrapX) {
29842997
if (typeof wrapX === 'undefined') { // getter
29852998
return {

0 commit comments

Comments
 (0)