矩形命中检测函数(多用于UI的按钮检测)底层数学算法
function hitTest(x, y) { if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { return true; } }
function hitTest(x, y) { if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { return true; } }