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.
#801 PShapeSVG(new XMLElement(svg string))
- Loading branch information
Showing
4 changed files
with
75 additions
and
7 deletions.
There are no files selected for viewing
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,27 @@ | ||
<!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"> | ||
void setup() { | ||
PShapeSVG s = new PShapeSVG(new XMLElement("<svg width='100%' height='100%' version='1.1' xmlns='http://www.w3.org/2000/svg'><rect width='300' height='100' style='fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)'/></svg>")); | ||
println(s.isVisible()); | ||
} | ||
</script><canvas id="display" ></canvas> | ||
<pre> | ||
void setup() { | ||
PShapeSVG s = new PShapeSVG(new XMLElement("<svg width='100%' height='100%' version='1.1' xmlns='http://www.w3.org/2000/svg'><rect width='300' height='100' style='fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)'/></svg>")); | ||
println(s.isVisible()); //prints true | ||
} | ||
|
||
</pre> | ||
</body> | ||
</html> | ||
|
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,30 @@ | ||
<!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() rotate.svg with Transformations</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"> | ||
PShape s; | ||
|
||
void setup() { | ||
background(125); | ||
size(400,400); | ||
s = loadShape("blue.svg"); | ||
smooth(); | ||
noLoop(); | ||
} | ||
|
||
void draw() { | ||
shape(s); | ||
} | ||
</script><canvas id="display" ></canvas> | ||
<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