Fetching contributors…
Cannot retrieve contributors at this time
46 lines (36 sloc) 1.43 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>EaselJS Example: Text</title>
<link href="assets/demoStyles.css" rel="stylesheet" type="text/css" />
<script src="http://code.createjs.com/easeljs-0.4.1.min.js"></script>
var canvas;
var stage;
var bmp;
function init() {
//find canvas and load images, wait for last image to load
canvas = document.getElementById("testCanvas");
stage = new Stage(canvas);
// Bitmap also supports construction with a URI to an image to load:
bmp = new Bitmap("assets/daisy.png");
// we want to do some work before we update the canvas,
// otherwise we could use Ticker.addListener(stage);
<body onload="init();">
<header id="header" class="EaselJS">
<h1><span class="text-product">Easel<strong>JS</strong></span> Bitmap URI</h1>
<p>Simple sample showing how to use image URIs with the <strong>Bitmap</strong> class.</p>
<p>Some browsers can not load images or access pixel data when running local files, and may throw a security error or not
work unless the content is running on a server.</p>
<div class="canvasHolder">
<canvas id="testCanvas" width="960" height="400"></canvas>