Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jrpg.findIn = function(needle, haystack){
- if(
- ((haystack.x + haystack.w >= needle.x && haystack.x <= needle.x + needle.w) &&
- (haystack.y <= needle.y + needle.h && haystack.y + haystack.h >= needle.y)) ||
- ((haystack.x + haystack.w >= needle.x && haystack.x <= needle.x + needle.w) &&
- (haystack.y + haystack.h <= needle.y + needle.h && haystack.y >= needle.y + needle.h)) ||
- ((haystack.x >= needle.x + needle.w && haystack.x + haystack.w <= needle.x + needle.w) &&
- (haystack.y <= needle.y + needle.h && haystack.y + haystack.h >= needle.y)) ||
- ((haystack.x >= needle.x && haystack.x + haystack.w <= needle.x + needle.w) &&
- (haystack.y + haystack.h <= needle.y + needle.h && haystack.y >= needle.y + needle.h))
- ){
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement