summaryrefslogtreecommitdiff
path: root/scripts/utils.scm
diff options
context:
space:
mode:
authorHenrique Alves <henrique.alves@itsjungle.xyz>2024-04-28 21:07:01 +0300
committerHenrique Alves <henrique.alves@itsjungle.xyz>2024-04-28 21:07:01 +0300
commitf6e3396a5a653c3ae124afcd74bac5c9c7e50ae1 (patch)
tree99bc7592c4184363c4d6a985d6c6dbc07688d71a /scripts/utils.scm
parent0d0db3e51ec95ab94befad01cbec0860acf8ffe1 (diff)
downloadgamejam-slgj-2024-f6e3396a5a653c3ae124afcd74bac5c9c7e50ae1.tar.gz
gamejam-slgj-2024-f6e3396a5a653c3ae124afcd74bac5c9c7e50ae1.tar.bz2
gamejam-slgj-2024-f6e3396a5a653c3ae124afcd74bac5c9c7e50ae1.zip
(wip) Basic textbox API
Diffstat (limited to 'scripts/utils.scm')
-rw-r--r--scripts/utils.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/utils.scm b/scripts/utils.scm
new file mode 100644
index 0000000..3348075
--- /dev/null
+++ b/scripts/utils.scm
@@ -0,0 +1,8 @@
+(define (is-point-inside-rect? point rect)
+ (cond ((not (point? point)) #f)
+ ((not (rect? rect)) #f)
+ (else (and (>= (point-x point) (rect-x rect))
+ (>= (point-y point) (rect-y rect))
+ (<= (point-x point) (+ (rect-x rect) (rect-width rect)))
+ (<= (point-y point) (+ (rect-y rect) (rect-height rect))))
+ )))