Skip to content

Commit cb8f54e

Browse files
committed
round of example fixes for #154
1 parent d0a0323 commit cb8f54e

9 files changed

Lines changed: 24 additions & 23 deletions

File tree

content/examples/Topics/Advanced Data/LoadSaveJSON/LoadSaveJSON.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Loading XML Data
2+
* Loading JSON Data
33
* by Daniel Shiffman.
44
*
55
* This example demonstrates how to use loadJSON()

content/examples_p5/Topics/Advanced Data/LoadSaveJSON/LoadSaveJSON.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var bubbles;
3636
var json;
3737

3838
function preload() {
39-
json = loadJSON("/data.json");
39+
json = loadJSON("data.json");
4040
}
4141

4242
function setup() {

content/examples_p5/Topics/Advanced Data/LoadSaveTable/LoadSaveTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var table;
2525
function preload() {
2626
// Load CSV file into a Table object
2727
// "header" option indicates the file has a header row
28-
table = loadTable("/data.csv", "header");
28+
table = loadTable("data.csv", "header");
2929
}
3030

3131
function setup() {

content/examples_p5/Topics/Animation/AnimatedSprite/Animation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function Animation(imagePrefix, count) {
88

99
for (var i = 0; i < this.imageCount; i++) {
1010
// Use nf() to number format 'i' into four digits
11-
var filename = 'data/' + imagePrefix + nf(i, 4) + ".gif";
11+
var filename = imagePrefix + nf(i, 4) + ".gif";
1212
this.images[i] = loadImage(filename);
1313
}
1414

content/examples_p5/Topics/Animation/Sequential/Sequential.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ var currentFrame = 0;
1717
var images = [];
1818

1919
function preload() {
20-
images[0] = loadImage("/PT_anim0000.gif");
21-
images[1] = loadImage("/PT_anim0001.gif");
22-
images[2] = loadImage("/PT_anim0002.gif");
23-
images[3] = loadImage("/PT_anim0003.gif");
24-
images[4] = loadImage("/PT_anim0004.gif");
25-
images[5] = loadImage("/PT_anim0005.gif");
26-
images[6] = loadImage("/PT_anim0006.gif");
27-
images[7] = loadImage("/PT_anim0007.gif");
28-
images[8] = loadImage("/PT_anim0008.gif");
29-
images[9] = loadImage("/PT_anim0009.gif");
30-
images[10] = loadImage("/PT_anim0010.gif");
31-
images[11] = loadImage("/PT_anim0011.gif");
20+
images[0] = loadImage("PT_anim0000.gif");
21+
images[1] = loadImage("PT_anim0001.gif");
22+
images[2] = loadImage("PT_anim0002.gif");
23+
images[3] = loadImage("PT_anim0003.gif");
24+
images[4] = loadImage("PT_anim0004.gif");
25+
images[5] = loadImage("PT_anim0005.gif");
26+
images[6] = loadImage("PT_anim0006.gif");
27+
images[7] = loadImage("PT_anim0007.gif");
28+
images[8] = loadImage("PT_anim0008.gif");
29+
images[9] = loadImage("PT_anim0009.gif");
30+
images[10] = loadImage("PT_anim0010.gif");
31+
images[11] = loadImage("PT_anim0011.gif");
3232

3333
// If you don't want to load each image separately
3434
// and you know how many frames you have, you

content/examples_p5/Topics/Drawing/Pattern/Pattern.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ function draw() {
2323
// for this program. It calculates the speed of the mouse
2424
// and draws a small ellipse if the mouse is moving slowly
2525
// and draws a large ellipse if the mouse is moving quickly
26-
2726
function variableEllipse(x, y, px, py) {
2827
var speed = abs(x-px) + abs(y-py);
2928
stroke(speed);
30-
ellipse(x, y, speed, speed);
29+
// hack to stop doing a giant one at the start
30+
if (speed < width/2) {
31+
ellipse(x, y, speed, speed);
32+
}
3133
}

content/examples_p5/Topics/GUI/Scrollbar/Scrollbar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ var img1, img2; // Two images to load
1414

1515
function preload() {
1616
// Load images
17-
img1 = loadImage("/seedTop.jpg");
18-
img2 = loadImage("/seedBottom.jpg");
17+
img1 = loadImage("seedTop.jpg");
18+
img2 = loadImage("seedBottom.jpg");
1919
}
2020

2121
function setup() {

content/examples_p5/Topics/Interaction/Tickle/Tickle.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ function setup() {
1717
canvas.parent("p5container");
1818

1919
// Create the font
20-
textFont("Georgia");
21-
textSize(36);
20+
textFont("Source Code Pro", 36);
2221
textAlign(CENTER, CENTER);
2322

2423
hr = textWidth(message) / 2;

content/examples_p5/testing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<head>
33
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.22/p5.min.js"></script>
44
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.22/addons/p5.dom.min.js"></script>
5-
<script language="javascript" type="text/javascript" src="Basics/Web/LoadingImages/LoadingImages.js"></script>
5+
<script language="javascript" type="text/javascript" src="Topics/Drawing/Pattern/Pattern.js"></script>
66
<script type="text/javascript">
77

88
// function setup() {

0 commit comments

Comments
 (0)