Skip to content

Commit d0eb239

Browse files
author
Lauren McCarthy
committed
Merge branch 'master' of github.com:processing/p5.js
2 parents 0e56e59 + 1a467ec commit d0eb239

File tree

16 files changed

+70
-27
lines changed

16 files changed

+70
-27
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ module.exports = function(grunt) {
441441
grunt.registerTask('yui:test', ['yuidoc:prod', 'connect', 'mocha:yui']);
442442
grunt.registerTask('yui:dev', [
443443
'yui:prod',
444-
'browserify',
444+
'build',
445445
'connect',
446446
'open:yui',
447447
'watch:yui'

src/core/p5.Element.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,19 @@ p5.Element.prototype.id = function(id) {
160160
* @method class
161161
* @param {String} class class to add
162162
* @chainable
163+
*
164+
* @example
165+
* <div class='norender'><code>
166+
* function setup() {
167+
* var cnv = createCanvas(100, 100);
168+
* // Assigns a CSS selector class 'small'
169+
* // to the canvas element.
170+
* cnv.class('small');
171+
* }
172+
* </code></div>
173+
*
174+
* @alt
175+
* no display.
163176
*/
164177
/**
165178
* @method class

src/image/p5.Image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ p5.Image.prototype.set = function(x, y, imgOrCol) {
409409
* <div><code>
410410
* var img;
411411
*
412-
* function setup() {
412+
* function preload() {
413413
* img = loadImage('assets/rockies.jpg');
414414
* }
415415

src/image/pixels.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,9 @@ p5.prototype.copy = function() {
265265
* <br><br>
266266
*
267267
* BLUR
268-
* Executes a Guassian blur with the level parameter specifying the extent
268+
* Executes a Gaussian blur with the level parameter specifying the extent
269269
* of the blurring. If no parameter is used, the blur is equivalent to
270-
* Guassian blur of radius 1. Larger values increase the blur.
270+
* Gaussian blur of radius 1. Larger values increase the blur.
271271
* <br><br>
272272
*
273273
* ERODE

src/webgl/loading.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ require('./p5.Geometry');
3838
* //draw a spinning teapot
3939
* var teapot;
4040
*
41+
* function preload() {
42+
* teapot = loadModel('assets/teapot.obj');
43+
* }
44+
*
4145
* function setup() {
4246
* createCanvas(100, 100, WEBGL);
43-
*
44-
* teapot = loadModel('assets/teapot.obj');
4547
* }
4648
*
4749
* function draw() {
@@ -218,10 +220,12 @@ function parseObj(model, lines) {
218220
* //draw a spinning teapot
219221
* var teapot;
220222
*
223+
* function preload() {
224+
* teapot = loadModel('assets/teapot.obj');
225+
* }
226+
*
221227
* function setup() {
222228
* createCanvas(100, 100, WEBGL);
223-
*
224-
* teapot = loadModel('assets/teapot.obj');
225229
* }
226230
*
227231
* function draw() {

src/webgl/material.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,12 @@ p5.prototype.normalMaterial = function() {
186186
* <div>
187187
* <code>
188188
* var img;
189+
* function preload() {
190+
* img = loadImage('assets/laDefense.jpg');
191+
* }
192+
*
189193
* function setup() {
190194
* createCanvas(100, 100, WEBGL);
191-
* img = loadImage('assets/laDefense.jpg');
192195
* }
193196
*
194197
* function draw() {

test/manual-test-examples/addons/p5.sound/loadSound_callback/sketch.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// Sound samples from Damscray - "Dancing Tiger",
22
// Creative Commons BY-NC-SA
33

4+
function preload() {
5+
soundFile = loadSound('../_files/Damscray_-_Dancing_Tiger_01', soundReady);
6+
}
47

58
function setup() {
69
createCanvas(400,200);
710
soundFormats('ogg', 'mp3');
8-
soundFile = loadSound('../_files/Damscray_-_Dancing_Tiger_01', soundReady);
911
}
1012

1113
function soundReady(){

test/manual-test-examples/addons/p5.sound/peakDetect_basic/sketch.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
var cnv, soundFile, fft, peakDetect;
22
var ellipseWidth = 10;
33

4+
function preload() {
5+
soundFile = loadSound('../_files/beat.mp3');
6+
}
7+
48
function setup() {
59
cnv = createCanvas(100,100);
610

7-
soundFile = loadSound('../_files/beat.mp3');
811
fft = new p5.FFT();
912
peakDetect = new p5.PeakDetect();
1013

test/manual-test-examples/addons/p5.sound/play_soundfile/sketch.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
// create a variable for the sound file
66
var soundFile;
77

8+
function preload() {
9+
// create a SoundFile
10+
soundFile = loadSound( ['../_files/beatbox.ogg', '../_files/beatbox.mp3'] );
11+
}
12+
813
function setup() {
914
createCanvas(400, 400);
1015
background(0);
1116

12-
// create a SoundFile
13-
soundFile = loadSound( ['../_files/beatbox.ogg', '../_files/beatbox.mp3'] );
14-
1517
createP('Press any key to play the sound');
1618
}
1719

test/manual-test-examples/addons/p5.sound/soundfile_playMode/sketch.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
var playMode = 'sustain';
88
var sample1, sample2, button;
99

10-
function setup() {
11-
createCanvas(0,0);
10+
function preload() {
1211
sample1 = loadSound( ['../_files/Damscray_-_Dancing_Tiger_01.ogg', '../_files/Damscray_-_Dancing_Tiger_01.mp3'] );
1312
sample2 = loadSound( ['../_files/Damscray_-_Dancing_Tiger_02.ogg', '../_files/Damscray_-_Dancing_Tiger_02.mp3'] );
13+
}
14+
15+
function setup() {
16+
createCanvas(0,0);
1417

1518
createP('Press "a" and "s" on your keyboard to play two different samples.<br> Trigger lots of sounds at once! Change mode to hear the difference');
1619

0 commit comments

Comments
 (0)