Skip to main content
The Deno 2 Release Candidate is here
Learn more
method ContainerHelper.prototype.findSlotForItem
import { ContainerHelper } from "https://deno.land/x/sptaki@1.2.0/helpers/ContainerHelper.d.ts";

Finds a slot for an item in a given 2D container map

Parameters

container2D: number[][]

Array of container with slots filled/free

itemWidth: number

Width of item

itemHeight: number

Height of item

Returns

Location to place item in container