Room Shape
Functions
Section titled “Functions”getGridIndexDelta()
Section titled “getGridIndexDelta()”getGridIndexDelta(
roomShape,doorSlot):int|undefined
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:22
Helper function to get the grid index delta that a door out of the given room shape would lead
to. For example, if you went through the bottom door in a room of RoomShape.SHAPE_1x2, you
would end up in a room with a grid index that is +26 units from the SafeGridIndex of where you
started.
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
doorSlot
Section titled “doorSlot”DoorSlot
Returns
Section titled “Returns”int | undefined
getRoomShapeBottomRightPosition()
Section titled “getRoomShapeBottomRightPosition()”getRoomShapeBottomRightPosition(
roomShape):Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:37
Helper function to see if a given room shape will grant a single charge or a double charge to the player’s active item(s).
For example, RoomShape.SHAPE_2x2 will return 2.
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”Readonly<Vector>
getRoomShapeBounds()
Section titled “getRoomShapeBounds()”getRoomShapeBounds(
roomShape): readonly [int,int]
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:49
Helper function to get the grid position of the bottom-right tile of a given room shape.
“Vector(0, 0)” corresponds to the top left tile of a room, not including the walls. (The top-left wall would be at “Vector(-1, -1)”.)
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”readonly [int, int]
getRoomShapeCharges()
Section titled “getRoomShapeCharges()”getRoomShapeCharges(
roomShape):int
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:61
Helper function to get the number of charges that a given room shape will grant to a player upon clearing it.
For example, RoomShape.SHAPE_2x2 will return 2.
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”int
getRoomShapeCorners()
Section titled “getRoomShapeCorners()”getRoomShapeCorners(
roomShape): readonlyCorner[]
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:71
Helper function to get the corners that exist in the given room shape.
Note that these corner locations are not accurate for the Mother Boss Room and the Home closet rooms. (Those rooms have custom shapes.)
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”readonly Corner[]
getRoomShapeLayoutSize()
Section titled “getRoomShapeLayoutSize()”getRoomShapeLayoutSize(
roomShape): readonly [int,int]
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:81
Helper function to get the dimensions of a room shape’s layout. This is NOT the size of the
room’s actual contents! For that, use the getRoomShapeBounds function.
For example, a horizontal narrow room has a layout size of equal to that of a 1x1 room.
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”readonly [int, int]
getRoomShapeTopLeftPosition()
Section titled “getRoomShapeTopLeftPosition()”getRoomShapeTopLeftPosition(
roomShape):Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:93
Helper function to get the grid position of the top-left tile of a given room shape.
“Vector(0, 0)” corresponds to the top left tile of a room, not including the walls. (The top-left wall would be at “Vector(-1, -1)”.)
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”Readonly<Vector>
getRoomShapeVolume()
Section titled “getRoomShapeVolume()”getRoomShapeVolume(
roomShape):int
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:105
Helper function to get the volume of a room shape, which is the amount of tiles that are inside the room.
(This cannot be directly calculated from the bounds since L rooms are a special case.)
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”int
getRoomShapeWidth()
Section titled “getRoomShapeWidth()”getRoomShapeWidth(
roomShape):int
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:109
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”int
is2x1RoomShape()
Section titled “is2x1RoomShape()”is2x1RoomShape(
roomShape):boolean
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:117
Helper function to determine if the provided room is equal to RoomShape.1x2 (4) or
RoomShape.2x1 (6).
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”boolean
isBigRoomShape()
Section titled “isBigRoomShape()”isBigRoomShape(
roomShape):boolean
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:125
Helper function to detect if the provided room shape is big. Specifically, this is all 1x2 rooms, 2x2 rooms, and L rooms.
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”boolean
isLRoomShape()
Section titled “isLRoomShape()”isLRoomShape(
roomShape):boolean
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:133
Helper function to determine if the provided room is equal to RoomShape.LTL (9),
RoomShape.LTR (10), RoomShape.LBL (11), or RoomShape.LBR (12).
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”boolean
isNarrowRoom()
Section titled “isNarrowRoom()”isNarrowRoom(
roomShape):boolean
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:141
Helper function to determine if the provided room is equal to RoomShape.IH (2), RoomShape.IV
(3), RoomShape.IIV (5), or RoomShape.IIH (7).
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”boolean
isRoomShapeDoubleCharge()
Section titled “isRoomShapeDoubleCharge()”isRoomShapeDoubleCharge(
roomShape):boolean
Defined in: packages/isaacscript-common/src/functions/roomShape.ts:151
Helper function to see if a given room shape will grant a single charge or a double charge to the player’s active item(s).
For example, RoomShape.SHAPE_2x2 will return true.
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”boolean
