Created
November 30, 2009 05:04
-
-
Save phinze/245266 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<title>A Processing.js Example</title> | |
<script type="text/javascript" src="js/processing.js"></script> | |
<script type="text/javascript" src="js/init.js"></script> | |
</head> | |
<body> | |
<script type="application/processing"> | |
size(600, 200); | |
background(102); | |
PFont fontA = loadFont("Arial"); | |
textFont(fontA, 32); | |
int x = 10; y = 50; | |
fill(0); | |
lineHeight = 40; | |
String localVar = "i am a local variable"; | |
text(localVar,x,y); | |
y += lineHeight; | |
String localFile = loadStrings("oneLine.txt"); | |
text(localFile,x,y); | |
y += lineHeight; | |
String remoteFile = loadStrings("http://sandbox.phinze.com/processing-js/load_strings/otherLine.txt"); | |
text(remoteFile,x,y); | |
</script> | |
<canvas></canvas> | |
</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
hello world local file here |
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
hello world file loaded via full URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment