Skip to main content
Module

x/tui/mod.ts>rectangleIntersection

🦕 Deno module for creating Terminal User Interfaces
Latest
function rectangleIntersection
Re-export
import { rectangleIntersection } from "https://deno.land/x/tui@2.1.11/mod.ts";

Calculate intersection between two rectangles

When data is set to true it returns:

  • collision rectangle when they collide
  • false when they don't

Otherwise it simply returns boolean whether they collide

Don't hold onto intersection object reference that gets returned!

It gets reused to save CPU usage and minimize GC.

Parameters

optional
data: false

Returns

boolean