1
function create(x,y,imagePath,imageWidth,imageHeight) {

return new Kinetic.QImage({
        x: x,
        y: y,
        image: images.Grid,
        width: imageWidth,
        height: imageHeight,
});

}


var a = create(100,100,images.Grid,96,96);

为什么这不起作用?

4

1 回答 1

0

看起来您收到有关名为 images 的未定义变量的错误...

而是这样做:

function create(x,y,images,imageWidth,imageHeight) {

return new Kinetic.QImage({
    x: x,
    y: y,
    image: images.Grid,
    width: imageWidth,
    height: imageHeight,
});

}


var a = create(100,100,images,96,96);
于 2012-10-30T15:24:20.523 回答