-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathHelloWorld.html
More file actions
executable file
·53 lines (41 loc) · 1.55 KB
/
HelloWorld.html
File metadata and controls
executable file
·53 lines (41 loc) · 1.55 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>EaselJS Example: Text</title>
<link href="../_assets/css/shared.css" rel="stylesheet" type="text/css"/>
<link href="../_assets/css/examples.css" rel="stylesheet" type="text/css"/>
<script src="../_assets/js/examples.js"></script>
<script src="../lib/easeljs-NEXT.js"></script>
<!-- We also provide hosted minified versions of all CreateJS libraries.
http://code.createjs.com -->
<script id="editable">
function init() {
// get a reference to the canvas we'll be working with:
var canvas = document.getElementById("testCanvas");
// create a stage object to work with the canvas. This is the top level node in the display list:
var stage = new createjs.Stage(canvas);
// Create a new Text object:
var text = new createjs.Text("Hello World!", "36px Arial", "#777");
text.textAlign = "center";
// add the text as a child of the stage. This means it will be drawn any time the stage is updated
// and that its transformations will be relative to the stage coordinates:
stage.addChild(text);
// position the text on screen, relative to the stage coordinates:
text.x = canvas.width / 2;
text.y = 180;
// call update on the stage to make it render the current display list to the canvas:
stage.update();
}
</script>
</head>
<body onload="init();">
<header class="EaselJS">
<h1>Hello World!</h1>
<p>Hello World example using <code>Text</code> and <code>Stage</code>.</p>
</header>
<div>
<canvas id="testCanvas" width="960" height="400"></canvas>
</div>
</body>
</html>