我想知道如何在AnimateCC代码面板中定位ID为'canvas'的现有canvas div?
当前我正在尝试的代码示例,仅输出到其他画布元素
这也是我也尝试针对现有画布的目标...
(function() {
var pixiHolder = document.createElement('pixiHolder');
pixiHolder.width = 300;
pixiHolder.height = 250;
document.getElementById('canvas').appendChild(pixiHolder);
renderer = new PIXI.autoDetectRenderer(pixiHolder.width,
pixiHolder.height, {
view: pixiHolder,
transparent: false,
backgroundColor: 0x223344
});
谢谢!
答案 0 :(得分:1)
尝试一下
var renderer = new PIXI.autoDetectRenderer(canvas.width, canvas.height, {
view: document.getElementById("yourCanvas"),
transparent: false
});