Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (outter-box-image)
- (overlay/align
- "left" "top"
- (rectangle 10 10 "outline" (send this current-color "handle"))
- (rectangle (+ width 40) (+ height 40) "outline" "black")))
- ;; Int Int -> Boolean
- (define (in-handle? mx my)
- (and
- (and
- (<= mx (+ (- x (+ 20 half-width)) 10))
- (>= mx (- x (+ 20 half-width))))
- (and
- (>= (- (- y half-height) 10) my)
- (<= (- (- y half-height) 20) my))))
- ;; Int Int -> Boolean
- (define (in-this? other-x other-y)
- (and
- (<= (- x (+ 20 half-width)) other-x (+ x (+ 20 half-width)))
- (<= (- y (+ 20 half-height)) other-y (+ y (+ 20 half-height)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement