Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. def insidebox(pos,rect):
  2. if pos.X>rect.topleft.X and pos.Y < rect.topleft.Y and pos.X < rect.bottomright.X and pos.Y > rect.bottomright.Y:
  3. return true
  4. '''If a point is greater than the x value of the the top left corner of a rectangle and less than the y value,
  5. while also being less than the x value and greater than the y of the bottom right corner it must be inide the rectangle.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement