0

不同的图像应该出现在舞台上。为此,我试图创建一个数组并将其放入容器中,但 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);
}
4

0 回答 0