Created
March 7, 2012 15:53
-
-
Save kled/1993927 to your computer and use it in GitHub Desktop.
HTML5:Creative JS startup
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>Creative JS</title> | |
<script src="creativejslibs/easel.js"></script> | |
<script src="creativejslibs/tween.js"></script> | |
<script> | |
var canvas; | |
var stage; | |
function init () { | |
canvas = document.getElementById( "canvas" ); | |
stage = new Stage( canvas ); | |
// Create a new Text object, and position it on stage: | |
var text = new Text("text on the canvas.", "36px Arial", "#000"); | |
text.textBaseline = "top"; // draw text relative to the top of the em box. | |
text.x = 100; | |
text.y = 80; | |
// text.rotation = 20; | |
//text.outline = true; | |
stage.addChild(text); | |
stage.update(); | |
} | |
</script> | |
</head> | |
<body onload="init();"> | |
<canvas id="canvas" width="800" height="600"></canvas> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment