1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
<html>
<head>
<script language="javascript" src="processing.init.js"></script>
<script language="javascript" src="processing.js"></script>
</head>
<body>
<script type="application/processing">
// Global variables
var fontA;
// Setup the Processing Canvas
void setup(){
//Size of canvas
size(250, 250);
noStroke();
fontA = loadFont("Verdana");
textFont(fontA, 10);
}
// Main draw loop
void draw(){
background(200);
fill(204, 120);
rect(0, 0, width, height);
fill(255);
ellipse(100, 100, 50, 50);
fill(0);
text("MyText", 100, 150);
}
</script>
<canvas width="250px" height="250px"></canvas>
</body>
</html> |