fantasy-console/util.ts
2023-05-05 16:39:51 -07:00

8 lines
195 B
TypeScript

export const inRect = (x: number, y: number, rectX: number, rectY: number, rectW: number, rectH: number) => {
return (
x >= rectX &&
x < rectX+rectW &&
y >= rectY &&
y < rectY+rectH
)
}