Permalink
Browse files

MWM

  • Loading branch information...
2 parents e6f3f43 + 3071f2b commit d9718a2a622b61f55474dee7df5de2175efefb53 Andor committed Jul 19, 2010
@@ -19,7 +19,7 @@
void setup() {
size(200, 200);
- pg = createGraphics(80, 80, P3D);
+ pg = createGraphics(80, 80);
}
void draw() {
@@ -47,7 +47,7 @@
void setup() {
size(200, 200);
- pg = createGraphics(80, 80, P3D);
+ pg = createGraphics(80, 80);
}
void draw() {
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="../../../processing.js"></script>
+ <link rel="stylesheet" href="../../style.css" />
+ </head>
+
+ <body>
+ <h1><a href="http://asalga.wordpress.com">Andor Salga</a></h1>
+ <h2>bug 755</a></h2>
+
+ <p>
+ <canvas datasrc="test.pjs" width="100" height="100"> </canvas>
+ </p>
+
+ <pre>
+<b>// Test from Processing.org</b>
+</pre>
+
+ </body>
+</html>
@@ -0,0 +1,86 @@
+import processing.opengl.*;
+
+void setup() {
+ size(500, 500, OPENGL);
+
+ PFont font = loadFont("Arial");
+ textFont(font,30);
+
+ fill(0);
+ pushMatrix();
+ translate(width/2, height/2, 0);
+ text("testing", 0,0,0);
+ popMatrix();
+
+ noFill();
+
+ stroke(0,0,255);
+ strokeWeight(2);
+ pushMatrix();
+ translate(width/2, height/2, 0);
+ for(int i=0; i < 10; i++){
+ line(random(-width/2, width/2), random(-height/2, height/2), random(-height/2, height/2),
+ random(-height/2, height/2),random(-height/2, height/2),random(-height/2, height/2));
+ }
+ popMatrix();
+
+ pushMatrix();
+ translate(width/2, height/2, 0);
+ text("testing", 0,30,0);
+ popMatrix();
+
+ stroke(255,0,0);
+ strokeWeight(3);
+ pushMatrix();
+ translate(width/2, height/2, 0);
+ for(int i=0; i < 100; i++){
+ point(random(-width/2, width/2), random(-height/2, height/2), 0);
+ }
+ popMatrix();
+
+ fill(0);
+ pushMatrix();
+ translate(width/2, height/2, 0);
+ text("testing", 0,60,0);
+ popMatrix();
+
+ stroke(0,255,0);
+ strokeWeight(1);
+ pushMatrix();
+ translate(width/2, height/2, 0);
+ for(int i=0; i < 10; i++){
+ rect(random(-width/2, width/2), random(-height/2, height/2),
+ random(15,25), random(15,25));
+ }
+ popMatrix();
+
+ fill(0);
+ pushMatrix();
+ translate(width/2, height/2, 0);
+ text("testing", 0,90,0);
+ popMatrix();
+
+ stroke(0,128,128);
+ strokeWeight(1);
+ pushMatrix();
+ translate(width/2, height/2, 0);
+ for(int i=0; i < 5; i++){
+ translate(random(-width/4, width/4), random(-height/4, height/4), 0);
+ sphere(40);
+ }
+ popMatrix();
+
+ fill(0);
+ pushMatrix();
+ translate(width/2, height/2, 0);
+ text("testing", 0,120,0);
+ popMatrix();
+
+ pushMatrix();
+ translate(width/2, height/2, 0);
+ for(int i=0; i < 5; i++){
+ translate(random(-width/4, width/4), random(-height/4, height/4), 0);
+ box(40);
+ }
+ popMatrix();
+}
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="../../../processing.js"></script>
+ <link rel="stylesheet" href="../../style.css" />
+ </head>
+ <body>
+ <h1>createGraphics() test - 3D</h1>
+
+ <p>
+ <canvas datasrc="createGraphics3D.pjs" height="200" width="200"></canvas>
+ </p>
+
+ <pre>
+PGraphics pg;
+float r = 0;
+
+void setup() {
+ size(200, 200);
+ pg = createGraphics(80, 80, P3D);
+}
+
+void draw() {
+ fill(0, 12);
+ rect(0, 0, width, height);
+ fill(255);
+ noStroke();
+ ellipse(mouseX, mouseY, 60, 60);
+
+ pg.beginDraw();
+ pg.background(255, 0, 0);
+ pg.noFill();
+ pg.stroke(255);
+ pg.pushMatrix();
+ pg.translate(40, 40, 0);
+ pg.rotateY(mouseY);
+ pg.rotateX(mouseX);
+ pg.box(20);
+ pg.popMatrix();
+ pg.endDraw();
+
+ image(pg, 60, 60);
+}
+ </pre>
+ </body>
+</html>
@@ -0,0 +1,29 @@
+PGraphics pg;
+float r = 0;
+
+void setup() {
+ size(200, 200);
+ pg = createGraphics(80, 80, P3D);
+}
+
+void draw() {
+ fill(0, 12);
+ rect(0, 0, width, height);
+ fill(255);
+ noStroke();
+ ellipse(mouseX, mouseY, 60, 60);
+
+ pg.beginDraw();
+ pg.background(255, 0, 0);
+ pg.noFill();
+ pg.stroke(255);
+ pg.pushMatrix();
+ pg.translate(40, 40, 0);
+ pg.rotateY(mouseY);
+ pg.rotateX(mouseX);
+ pg.box(20);
+ pg.popMatrix();
+ pg.endDraw();
+
+ image(pg, 60, 60);
+}
@@ -0,0 +1,122 @@
+<!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 test of textAlign()</title>
+ <script type="text/javascript" src="../../../processing.js"></script>
+ <script type="text/javascript" src="../../init.js"></script>
+ <style type="text/css">
+ html, body
+ {
+ background: #EEE;
+ font-family: Arial;
+ font-size: 13px;
+ margin: 0;
+ padding: 0;
+ }
+ h1
+ {
+ background: #385C85;
+ color: #FFF;
+ padding: 10px;
+ padding-left: 20px;
+ margin-top: 0px;
+ }
+ h1 a
+ {
+ color: #FFF;
+ }
+ h2
+ {
+ padding-left: 20px;
+ }
+ p
+ {
+ padding-left: 20px;
+ line-height: 1.3em;
+ }
+ p a
+ {
+ color: #385C85;
+ }
+ canvas
+ {
+ margin: 10px 0;
+ }
+ pre
+ {
+ margin-left: 20px;
+ margin-right: 20px;
+ padding: 5px;
+ background: #FFF;
+ border-top: 1px solid #333;
+ border-bottom: 1px solid #333;
+ }
+ div.ref-col
+ {
+ float: left;
+ width: 32%;
+ }
+ </style>
+</head>
+<body>
+ <h1>textAlign() align tests</h1>
+ <p>
+ <!-- copy paste your processing code below this script tag -->
+ <script id="script" type="application/processing">
+
+size(400, 400);
+background(0);
+stroke(128);
+fill(255);
+
+line(10, 10, 10,30); line(10, 30, 50, 30);
+text("default", 15, 25);
+
+line(210, 10, 270, 10); line(210, 10, 210, 40);
+line(210, 40, 270, 40); line(270, 10, 270, 40);
+text("default", 210,10,60,30);
+
+line(10, 70, 380, 70);
+line(10, 120, 380, 120);
+line(130, 50, 130, 140);
+line(260, 50, 260, 140);
+textAlign(RIGHT, BOTTOM); text("RiBo", 125, 65);
+textAlign(RIGHT, CENTER); text("RiCe", 125, 95);
+textAlign(RIGHT, TOP); text("RiTo", 125, 125);
+textAlign(CENTER, BOTTOM); text("CeBo", 195, 65);
+textAlign(CENTER, CENTER); text("CeCe", 195, 95);
+textAlign(CENTER, TOP); text("CeTo", 195, 125);
+textAlign(LEFT, BOTTOM); text("LeBo", 265, 65);
+textAlign(LEFT, CENTER); text("LeCe", 265, 95);
+textAlign(LEFT, TOP); text("LeTo", 265, 125);
+
+line(0, 220, 390, 220);
+line(0, 270, 390, 270);
+line(0, 320, 390, 320);
+line(0, 370, 390, 370);
+line(0, 220, 0, 370);
+line(130, 220, 130, 370);
+line(260, 220, 260, 370);
+line(390, 220, 390, 370);
+textAlign(RIGHT, BOTTOM); text("RiBo", 5, 225, 120, 40);
+textAlign(RIGHT, CENTER); text("RiCe", 5, 275, 120, 40);
+textAlign(RIGHT, TOP); text("RiTo", 5, 325, 120, 40);
+textAlign(CENTER, BOTTOM); text("CeBo", 135, 225, 120, 40);
+textAlign(CENTER, CENTER); text("CeCe", 135, 275, 120, 40);
+textAlign(CENTER, TOP); text("CeTo", 135, 325, 120, 40);
+textAlign(LEFT, BOTTOM); text("LeBo", 265, 225, 120, 40);
+textAlign(LEFT, CENTER); text("LeCe", 265, 275, 120, 40);
+textAlign(LEFT, TOP); text("LeTo", 265, 325, 120, 40);
+
+ </script>
+ <canvas id="display"></canvas>
+ <br />
+ <pre style="border-style: dotted; border-width: 1px; background-color: #FFFFFF; padding: 2px; margin: 5px" id="scriptDisplay">
+ </pre>
+ <script>
+ document.getElementById("scriptDisplay").innerHTML = document.getElementById("script").text;
+ </script>
+ <br />
+</body>
+</html>
+
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<head>
- <script src="../../../../processing.js"></script>
- <link rel="stylesheet" href="../../../style.css" />
+ <script src="../../../../../processing.js"></script>
+ <link rel="stylesheet" href="../../../../style.css" />
</head>
<body>
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<head>
- <script src="../../../../processing.js"></script>
- <link rel="stylesheet" href="../../../style.css" />
+ <script src="../../../../../processing.js"></script>
+ <link rel="stylesheet" href="../../../../style.css" />
</head>
<body>
Oops, something went wrong.

0 comments on commit d9718a2

Please sign in to comment.