Skip to content

Class "GridEntity"⚓︎

Children Classes⚓︎

GridEntityDoor, GridEntityPit, GridEntityPoop, GridEntityPressurePlate, GridEntityRock, GridEntitySpikes, GridEntityTNT

Functions⚓︎

Destroy ()⚓︎

boolean Destroy ( boolean Immediate )⚓︎


Get·Grid·Index ()⚓︎

int GetGridIndex ( )⚓︎


Get·Save·State ()⚓︎

GridEntityDesc GetSaveState ( )⚓︎


Get·Type ()⚓︎

GridEntityType GetType ( )⚓︎


Get·Variant ()⚓︎

int GetVariant ( )⚓︎


Hurt ()⚓︎

boolean Hurt ( int Damage )⚓︎


Init ()⚓︎

void Init ( int Seed )⚓︎


Post·Init ()⚓︎

void PostInit ( )⚓︎


Render ()⚓︎

void Render ( Vector Offset )⚓︎


Set·Type ()⚓︎

void SetType ( GridEntityType Type )⚓︎


Set·Variant ()⚓︎

void SetVariant ( int Variant )⚓︎


To·Door ()⚓︎

GridEntityDoor ToDoor ( )⚓︎


To·Pit ()⚓︎

GridEntityPit ToPit ( )⚓︎


To·Poop ()⚓︎

GridEntityPoop ToPoop ( )⚓︎


To·Pressure·Plate ()⚓︎

GridEntityPressurePlate ToPressurePlate ( )⚓︎


To·Rock ()⚓︎

GridEntityRock ToRock ( )⚓︎


To·Spikes ()⚓︎

GridEntitySpikes ToSpikes ( )⚓︎


To·TNT ()⚓︎

GridEntityTNT ToTNT ( )⚓︎


Update ()⚓︎

void Update ( )⚓︎


Variables⚓︎

Collision·Class⚓︎

CollisionClass CollisionClass⚓︎


Desc⚓︎

GridEntityDesc Desc⚓︎


Position⚓︎

const Vector Position⚓︎

Returns the position of the grid cell's center point


RNG⚓︎

RNG RNG⚓︎


Sprite⚓︎

Sprite Sprite⚓︎


State⚓︎

int State⚓︎


Var·Data⚓︎

int VarData⚓︎

A Variable that stores some entity-specific data. The content can have completely different effects for different GridEntities.

Example Code

This code spawns a functioning Void Portal into the center of the room. This will teleport you to the floor "The Void" and will have the same appearance as the vanilla portal:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
-- get grid in center of room
local spawnPos = Game():GetRoom():GetGridPosition(67)
-- spawn Trapdoor
local portalEntity = Isaac.GridSpawn(GridEntityType.GRID_TRAPDOOR, 0, spawnPos, true) 
-- set VoidPortal behavior (Teleport to void and Pulse effect shader)
portalEntity.VarData = 1 
-- Replace spritesheet of trapdoor to look like a Void Portal
local sprite = portalEntity.Sprite
sprite:ReplaceSpritesheet(0, "gfx/grid/voidtrapdoor.png")
sprite:LoadGraphics()
sprite:Load("gfx/grid/voidtrapdoor.anm2", true)
portalEntity.Sprite = sprite



Last update: June 9, 2021