like2d
    Preparing search index...

    Type Alias Rectangle

    Rectangle: [number, number, number, number]

    A four-coordinate type [x, y, width, height]. Full reference Rect.

    const beastPen: Rectangle = [20, 25, 40, 50];
    
    const beastPen: Rectangle = Rect.setCenter( 
    [0, 0, ...penSize],
    beastPos
    );
    [x, y, w, h] = beastPen;
    
    const penPos = Rect.position(beastPen);
    const penSize = Rect.size(beastPen);
    const isInPen = Rect.containsPoint(
    beastPen,
    beast.pos,
    )
    beast.pos = Rect.clampPoint(beast.pos, beastPen)