2012-10-30 27 views
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); 

爲什麼不能正常工作?Kinetic JS func不是退貨對象

+1

詢問錯誤時,請給你的錯誤的詳細信息。它會讓那些願意幫助你的人變得更加輕鬆。 – Sheena

+0

爲什麼你'爲什麼不這樣做'?你有錯誤?沒有錯誤,但沒有發生?等 – BBog

回答

0

它看起來像你得到關於稱爲圖像未定義變量的錯誤...

做到這一點,而:

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); 
+0

不起作用... :( – Arti