我正在尝试检查 My (Loc) 和 CandyLocation 之间的冲突。我收到此错误 Uncaught TypeError: loc.localToLocal is not a function.
知道我做错了什么或者如何解决它吗?
var loc;
function checkIfeatingFood() {
loc = locations[locations.length - 1];
// for (var j = 0; j < candyLocations.length; j++) {
for (var j = 0; j < answersContainer.children.length; j++) {
var candyLocation = answersContainer.children[j];
candyLocation.alpha = .2;
var pt = loc.localToLocal(100, 0, candyLocation);
console.log(candyLocation.x, candyLocation.y); // the position local to objB
if (candyLocation.hitTest(pt.x, pt.y)) { candyLocation.alpha = 1; }
}
//return false;
}
最佳答案
您确定 loc 是 DisplayObject 吗?
关于javascript - Createjs碰撞问题localToLocal not a function错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36990185/