UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

49 lines 2.05 kB
/** * These functions have to do with the grid index inside of a room (i.e. the grid index that grid * entities use). * * For functions having to do with the room grid index of the level, see the "Level Grid" functions. * * @module */ import type { RoomShape } from "isaac-typescript-definitions"; /** * Helper function to convert grid coordinates to a world position `Vector`. * * For example, the coordinates of (0, 0) are equal to `Vector(80, 160)`. */ export declare function gridCoordinatesToWorldPosition(x: int, y: int): Readonly<Vector>; /** * Helper function to convert a grid index to a grid position. * * For example, in a 1x1 room, grid index 0 is equal to "Vector(-1, -1) and grid index 16 is equal * to "Vector(0, 0)". */ export declare function gridIndexToGridPosition(gridIndex: int, roomShape: RoomShape): Readonly<Vector>; /** * Helper function to convert a grid position `Vector` to a world position `Vector`. * * For example, the coordinates of (0, 0) are equal to `Vector(80, 160)`. */ export declare function gridPositionToWorldPosition(gridPosition: Vector): Readonly<Vector>; /** * Test if a grid position is actually in the given `RoomShape`. * * In this context, the grid position of the top-left wall is "Vector(-1, -1)". */ export declare function isValidGridPosition(gridPosition: Vector, roomShape: RoomShape): boolean; /** * Helper function to convert a world position `Vector` to a grid position `Vector`. * * In this context, the grid position of the top-left wall is "Vector(-1, -1)". */ export declare function worldPositionToGridPosition(worldPos: Vector): Readonly<Vector>; /** * Helper function to convert a world position `Vector` to a grid position `Vector`. * * In this context, the grid position of the top-left wall is "Vector(-1, -1)". * * This is similar to the `worldPositionToGridPosition` function, but the values are not rounded. */ export declare function worldPositionToGridPositionFast(worldPos: Vector): Readonly<Vector>; //# sourceMappingURL=roomGrid.d.ts.map