使用easeljs和preloadjs将各种图像添加到舞台上

时间:2014-11-10 10:17:15

标签: easeljs preloadjs

舞台上应出现不同的图像。为此,我试图创建一个数组并将其放在容器中,但id不起作用。我究竟做错了什么?感谢

canvas = document.getElementById("testCanvas");
stage = new createjs.Stage(canvas);
var queue = new createjs.LoadQueue(true);
var imagesPic = queue.loadManifest(["image1.png", "image2.png","image3.png","image4.png"]);

var w = canvas.width = window.innerWidth;
var h = canvas.height = window.innerHeight;

container = new createjs.Container();
stage.addChild(container);

captureContainers = [];
captureIndex = 0;

for (var i=0; i<50; i++) {
        container.addChild(imagesPic);  
}

for (i=0; i<100; i++) {
        var captureContainer = new createjs.Container();
        captureContainer.cache(0,0,w,h);
        captureContainers.push(captureContainer);
}

0 个答案:

没有答案