Created
September 27, 2011 03:34
-
-
Save arpit/1244268 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
<!doctype html> | |
<html> | |
<head> | |
<title>Hello Canvas</title> | |
<style> | |
#can{ | |
background:#dfdfdf; | |
} | |
</style> | |
</head> | |
<body> | |
<canvas id="can" height="320" width="300"> | |
</canvas> | |
<script> | |
var can = document.getElementById("can"); | |
var ctx = can.getContext("2d"); | |
ctx.fillStyle = "#fff"; | |
function randomXToY(minVal,maxVal){ | |
var randVal = minVal+(Math.random()*(maxVal-minVal)); | |
return randVal | |
} | |
for(var i=0; i<60; i++){ | |
ctx.font=randomXToY(14, 40)+"pt Helvetica"; | |
ctx.fillText("Action", randomXToY(10,260), randomXToY(0,280)); | |
//ctx.fillText("Action", randomXToY(80,160), i*40); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment