【发布时间】:2016-06-01 07:23:11
【问题描述】:
我试图将这个 h1 插入到 canvas 中。但它没有显示。无论如何要在画布内集成 w3school html 而无需使用easeljs 过程创建文本。我在画布内添加了这个。
<body onload="init();" style="background-color:#D4D4D4">
<canvas id="canvas" width="550" height="300" style="background-color:#ffffff">
<h1> i like this </h1>
</canvas>
<script>
function init() {
canvas = document.getElementById("canvas");
exportRoot = new lib.Untitled1();
stage = new createjs.Stage(canvas);
stage.addChild(exportRoot);
stage.update();
createjs.Ticker.setFPS(24);
createjs.Ticker.addEventListener("tick", stage);
}
</script>
</head>
<body onload="init();" style="background-color:#D4D4D4">
<canvas id="canvas" width="550" height="300" style="background-color:#ffffff">
<h1> i like this </h1>
</canvas>
【问题讨论】:
-
作为后续,您是否有某些原因没有在 Flash 中添加文本然后导出?
标签: javascript canvas createjs