Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. (define (outter-box-image)
  2. (overlay/align
  3. "left" "top"
  4. (rectangle 10 10 "outline" (send this current-color "handle"))
  5. (rectangle (+ width 40) (+ height 40) "outline" "black")))
  6.  
  7. ;; Int Int -> Boolean
  8. (define (in-handle? mx my)
  9. (and
  10. (and
  11. (<= mx (+ (- x (+ 20 half-width)) 10))
  12. (>= mx (- x (+ 20 half-width))))
  13. (and
  14. (>= (- (- y half-height) 10) my)
  15. (<= (- (- y half-height) 20) my))))
  16.  
  17. ;; Int Int -> Boolean
  18. (define (in-this? other-x other-y)
  19. (and
  20. (<= (- x (+ 20 half-width)) other-x (+ x (+ 20 half-width)))
  21. (<= (- y (+ 20 half-height)) other-y (+ y (+ 20 half-height)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement