forked from processing-js/processing-js
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed spaces/superfluous valOf added illegal path check removed speci…
…al handling of m [#798 state:peer-review-requested]
- Loading branch information
Showing
9 changed files
with
229 additions
and
37 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head runat="server"> | ||
<title>Processing.js SVG LoadImage() bot.svg</title> | ||
<script type="text/javascript" src="../../../processing.js"></script> | ||
<script type="text/javascript" src="../../init.js"></script> | ||
|
||
</head> | ||
<body> | ||
|
||
|
||
<script id="script" type="application/processing"> | ||
/** | ||
* Ignore Styles. | ||
* Illustration by George Brower. | ||
* | ||
* Shapes are loaded with style information that tells them how | ||
* to draw (the color, stroke weight, etc.) The disableStyle() | ||
* method of PShape turns off this information. The enableStyle() | ||
* method turns it back on. | ||
*/ | ||
|
||
PShape bot; | ||
PShape bot2; | ||
void setup() { | ||
size(800, 500); | ||
smooth(); | ||
// The file "bot1.svg" must be in the data folder | ||
// of the current sketch to load successfully | ||
bot = loadShape("S.svg"); | ||
bot2 = loadShape("ssmall.svg"); | ||
noLoop(); | ||
} | ||
|
||
void draw() { | ||
background(102); | ||
|
||
// Draw left bot | ||
bot.disableStyle(); // Ignore the colors in the SVG | ||
fill(0, 102, 153); // Set the SVG fill to blue | ||
stroke(255); // Set the SVG fill to white | ||
shape(bot, 0, 5); | ||
|
||
// Draw right bot | ||
bot.enableStyle(); | ||
shape(bot, 320, 5); | ||
|
||
// Draw left bot | ||
bot2.disableStyle(); // Ignore the colors in the SVG | ||
fill(0, 102, 153); // Set the SVG fill to blue | ||
stroke(255); // Set the SVG fill to white | ||
shape(bot2, 0, 210); | ||
|
||
// Draw right bot | ||
bot2.enableStyle(); | ||
shape(bot2, 320, 210); | ||
} | ||
</script><canvas id="display" ></canvas> | ||
<div> The actual shape: <img src="s.jpg"></div> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head runat="server"> | ||
<title>Processing.js SVG LoadImage() bot.svg</title> | ||
<script type="text/javascript" src="../../../processing.js"></script> | ||
<script type="text/javascript" src="../../init.js"></script> | ||
|
||
</head> | ||
<body> | ||
|
||
|
||
<script id="script" type="application/processing"> | ||
/** | ||
* Ignore Styles. | ||
* Illustration by George Brower. | ||
* | ||
* Shapes are loaded with style information that tells them how | ||
* to draw (the color, stroke weight, etc.) The disableStyle() | ||
* method of PShape turns off this information. The enableStyle() | ||
* method turns it back on. | ||
*/ | ||
|
||
PShape bot; | ||
PShape bot2; | ||
void setup() { | ||
size(640, 440); | ||
smooth(); | ||
// The file "bot1.svg" must be in the data folder | ||
// of the current sketch to load successfully | ||
bot = loadShape("T.svg"); | ||
bot2 = loadShape("tsmall.svg"); | ||
noLoop(); | ||
} | ||
|
||
void draw() { | ||
background(102); | ||
|
||
// Draw left bot | ||
bot.disableStyle(); // Ignore the colors in the SVG | ||
fill(0, 102, 153); // Set the SVG fill to blue | ||
stroke(255); // Set the SVG fill to white | ||
shape(bot, 20, 5, 300, 300); | ||
|
||
// Draw right bot | ||
bot.enableStyle(); | ||
shape(bot, 320, 5, 300, 300); | ||
|
||
// Draw left bot | ||
bot2.disableStyle(); // Ignore the colors in the SVG | ||
fill(0, 102, 153); // Set the SVG fill to blue | ||
stroke(255); // Set the SVG fill to white | ||
shape(bot2, 20, 210, 300, 300); | ||
|
||
// Draw right bot | ||
bot2.enableStyle(); | ||
shape(bot2, 320, 210, 300, 300); | ||
} | ||
</script><canvas id="display" ></canvas> | ||
<div> The actual shape: <img src="t.jpg"></div> | ||
</body> | ||
</html> | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters