Skip to content

Instantly share code, notes, and snippets.

@kled
Created March 7, 2012 15:53
Show Gist options
  • Save kled/1993927 to your computer and use it in GitHub Desktop.
Save kled/1993927 to your computer and use it in GitHub Desktop.
HTML5:Creative JS startup
<!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