# Class "Isaac"

## Functions

### AddCallback () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### void AddCallback ( table ref, int callbackId, table callbackFn, int entityId ) {: .copyable aria-label='Functions' }

### AddPillEffectToPool () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int AddPillEffectToPool ( int pillEffect ) {: .copyable aria-label='Functions' }

returns pill color

### ConsoleOutput () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### void ConsoleOutput ( string text ) {: .copyable aria-label='Functions' }

Prints a string into the Debug Console

???- example "Example Code" You can use this example as an alternative.

```lua
    Isaac.ConsoleOutput("This is a Test.")
    -- Output: This is a Test.

    -- Alternatively:
    print("This is a Test.")
    -- Output: This is a Test.
```

### CountBosses () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int CountBosses ( ) {: .copyable aria-label='Functions' }

Returns the number of bosses in the current room.

### CountEnemies () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int CountEnemies ( ) {: .copyable aria-label='Functions' }

Returns the number of enemies in the current room.

### CountEntities () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int CountEntities ( [Entity](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Entity/README.md) Spawner, int Type, int Variant, int Subtype ) {: .copyable aria-label='Functions' }

Returns the number of entities in the current room that fulfill the specified requirements. Spawner refers to an entity object (can be `:::lua nil`) Type refers to the found entity's type (Can be `:::lua EntityType.ENTITY_NULL`) Variant and Subtype refer to the found entitys Variant and Subtype (Can be `:::lua -1`)

### DebugString () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### void DebugString ( string str ) {: .copyable aria-label='Functions' }

Prints a string into the log file. You can find this file here `:::lua C:\Users\Jan\Documents\My Games\Binding of Isaac Afterbirth+\log.txt`

???- example "Example Code" This code prints `:::lua "This is a Test."` in the log.txt file.

```lua
    Isaac.DebugString("This is a Test.")
    -- Output: Lua Debug: This is a Test.
```

### ExecuteCommand () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### string ExecuteCommand ( string command ) {: .copyable aria-label='Functions' }

This function executes a debug console command. see the [Debug Console Tutorial](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/tutorials/DebugConsole/README.md) for informations on how to use commands.

### Explode () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### void Explode ( [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) pos, [Entity](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Entity/README.md) source, float damage ) {: .copyable aria-label='Functions' }

Spawn an explosion on a specified location.

### FindByType () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### table FindByType ( int Type, int Variant, int Subtype, boolean Cache, boolean IgnoreFriendly ) {: .copyable aria-label='Functions' }

Returns entities based on Type, Variant, Subtype. If Variant and/or Subtype is -1 then everything is includedUse Cache flag for multiple calls per frame.

### FindInRadius () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### table FindInRadius ( [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) Position, float Radius, int Partitions ) {: .copyable aria-label='Functions' }

Returns entities in range of Radius from Position filtered by Partitions mask (see [EntityPartition enum](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/enums/EntityPartition/README.md)) (include all = 0xffffffff)

This function does not return the entities sorted by nearest first, but based on the order they were loaded.

### GetCardIdByName () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetCardIdByName ( string cardHudName ) {: .copyable aria-label='Functions' }

Returns the CardID based on its hud value. (File: pocketitems.xml)

???- note "Notes" The name of this function is misleading, this function will only work with the hud value of a card and not the name of a card.

???- example "Example Code" This code gets the CardID of XVI - The Tower.

```lua
    Isaac.GetCardIdByName("16_TheTower")
    --Returns: 17
```

### GetChallenge () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetChallenge ( ) {: .copyable aria-label='Functions' }

Returns the ID of a challenge the player is currently in. Returns 0 if the player is not playing any challenge.

### GetChallengeIdByName () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetChallengeIdByName ( string challengeName ) {: .copyable aria-label='Functions' }

Returns the ChallengeID of a challenge based on its name. (File: challenges.xml)

???- example "Example Code" This code gets the ChallengeID of Aprils fool.

```lua
    Isaac.GetChallengeIdByName("Aprils fool")
    --Returns: 32
```

### GetCostumeIdByPath () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetCostumeIdByPath ( string path ) {: .copyable aria-label='Functions' }

Returns the CostumeID of a costume based on its file path. (File: costumes2.xml)

???- example "Example Code" This code gets the CostumeID of the Poop transformation costume.

```lua
    Isaac.GetCostumeIdByPath("gfx/characters/n027_Transformation_Poop.anm2")
    --Returns: 27
```

### GetCurseIdByName () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetCurseIdByName ( string curseName ) {: .copyable aria-label='Functions' }

Returns the CurseID of a curse based on its name. (File: curses.xml)

???- example "Example Code" This code gets the CurseID of Curse of the Unknown.

```lua
    Isaac.GetCurseIdByName("Curse of the Unknown")
    --Returns: 4
```

### GetEntityTypeByName () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetEntityTypeByName ( string entityName ) {: .copyable aria-label='Functions' }

Returns the EntityType of an entity based on its name. (File: entities2.xml)

???- note "Notes" There is no SubType version of this function.

???- example "Example Code" This code gets the EntityType of Flaming Gaper.

```lua
    Isaac.GetEntityTypeByName("Flaming Gaper")
    --Returns: 10
```

### GetEntityVariantByName () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetEntityVariantByName ( string entityName ) {: .copyable aria-label='Functions' }

Returns the variant of an entity based on its name. (File: entities2.xml)

???- note "Notes" There is no SubType version of this function.

???- example "Example Code" This code gets the variant of Flaming Gaper.

```lua
    Isaac.GetEntityVariantByName("Flaming Gaper")
    --Returns: 2
```

### GetFrameCount () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetFrameCount ( ) {: .copyable aria-label='Functions' }

Returns the amount of frames the game as a whole is running. The counter increases even when the game is paused or when you are in the main menu! 1 second equals roughtly 60 frames. This function therefore works drastically different than `:::lua Game():GetFrameCount()`[Link](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Game/README.md#GetFrameCount)

### GetFreeNearPosition () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) GetFreeNearPosition ( [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) pos, float step ) {: .copyable aria-label='Functions' }

### GetItemConfig () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### [Config](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/ItemConfig_Config/README.md) GetItemConfig ( ) {: .copyable aria-label='Functions' }

Returns the [ItemConfig::Config](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/ItemConfig_Config/README.md) object.

### GetItemIdByName () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetItemIdByName ( string itemName ) {: .copyable aria-label='Functions' }

Returns the ItemID of a Collectible. (File: items.xml)

???- example "Example Code" This code gets the ItemID of Brimstone.

```lua
    Isaac.GetItemIdByName("Brimstone")
    --Returns: 118
```

### GetMusicIdByName () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetMusicIdByName ( string musicName ) {: .copyable aria-label='Functions' }

Returns the MusicID of a music track. (File: music.xml)

???- example "Example Code" This code gets the MusicID of the Title Screen.

```lua
    Isaac.GetMusicIdByName("Title Screen")
    --Returns: 61
```

### GetPillEffectByName () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetPillEffectByName ( string pillEffect ) {: .copyable aria-label='Functions' }

Returns the PillEffectID based on its name. (File: pocketitems.xml)

???- example "Example Code" This code gets the PillEffectID of I can see forever!.

```lua
    Isaac.GetPillEffectByName("I can see forever!")
    --Returns: 23
```

### GetPlayer () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### [EntityPlayer](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/EntityPlayer/README.md) GetPlayer ( int playerId ) {: .copyable aria-label='Functions' }

Returns the EntityPlayer which the user is controlling. 0 = Main player. Higher numbers refer to coop babies.

???- example "Example Code"

```lua
    Isaac.GetPlayer(0)
```

### GetPlayerTypeByName () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetPlayerTypeByName ( string playerName ) {: .copyable aria-label='Functions' }

Returns the PlayerType of a character based on its name. (File: players.xml)

???- example "Example Code" This code gets the PlayerType of Azazel.

```lua
    Isaac.GetPlayerTypeByName("Azazel")
    --Returns: 7
```

### GetRandomPosition () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) GetRandomPosition ( ) {: .copyable aria-label='Functions' }

Returns a random position inside the current room. The Return value is a Vector containing the position in world coordinates.

### GetRoomEntities () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### table GetRoomEntities ( ) {: .copyable aria-label='Functions' }

Returns a table containing all entities in the room.

### GetSoundIdByName () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetSoundIdByName ( string soundName ) {: .copyable aria-label='Functions' }

Returns the SoundEffectID of a sound based on its name. (File: sounds.xml)

???- example "Example Code" This code gets the SoundEffectID of a sound named "Custom Sound Effect"

```lua
    Isaac.GetSoundIdByName("Custom Sound Effect")
```

### GetTextWidth () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetTextWidth ( string str ) {: .copyable aria-label='Functions' }

Returns the width of the given string in pixels based on the "terminus8" font (same font as used in Isaac.RenderText())

### GetTime () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetTime ( ) {: .copyable aria-label='Functions' }

Returns the current game time in milliseconds. This includes pauses!

### GetTrinketIdByName () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### int GetTrinketIdByName ( string trinketName ) {: .copyable aria-label='Functions' }

Returns the TrinketType of a trinket based on its name. (File: items.xml)

???- example "Example Code" This code gets the TrinketType of Lucky Toe.

```lua
    Isaac.GetTrinketIdByName("Lucky Toe")
    --Returns: 42
```

### GridSpawn () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### [GridEntity](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/GridEntity/README.md) GridSpawn ( [GridEntity](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/GridEntity/README.md) gridEntityType, int Variant, [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) position, boolean forced ) {: .copyable aria-label='Functions' }

Spawn a [GridEntity](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/GridEntity/README.md) at the given position (world coordinates).

???+ bug "Bugs" forced has no effect and will NOT override the grid entity at the given location. Remove a grid entity at the given location if nessesary before spawning something again.

### HasModData () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### boolean HasModData ( table ref ) {: .copyable aria-label='Functions' }

Returns "true" if your mod has Data stored using the "SaveModData()" function. Aka. if there is a "saveX.dat" file in your mod folder.There are 3 "saveX.dat" files, one per Savegame. They are stored in the mod's folder next to the "main.lua" file. The number indicates the savegame it corresponds to. The number will be determined automatically by the game.

### LoadModData () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### string LoadModData ( table ref ) {: .copyable aria-label='Functions' }

Returns a JSON array/table that was stored in a "saveX.dat" file using the "SaveModData()" function. If there is no "saveX.dat" file in your mod, this function will return an empty string. There are 3 "saveX.dat" files, one per Savegame. They are stored in the mod's folder next to the "main.lua" file. The number indicates the savegame it corresponds to. The number will be determined automatically by the game.

???- example "Example Code" This code loads data stored in the "saveX.dat" file, if it exists.

```lua
    local yourMod = RegisterMod("someMod", 1)
    local json = require("json")
    -- ...
    function yourMod:OnGameStart(isSave)
        --Loading Moddata--
        if yourMod:HasData() then
            local myTable = json.decode(Isaac.LoadModData(yourMod))
        end
    end
    yourMod:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, yourMod.OnGameStart)
```

### RegisterMod () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### void RegisterMod ( table ref, string modName, int apiVersion ) {: .copyable aria-label='Functions' }

Method to define a mod in the game. THIS NEEDS TO BE DEFINED IN EVERY MOD!

???- example "Example Code"

```lua
    local yourMod = RegisterMod("someMod", 1)
```

### RemoveCallback () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### void RemoveCallback ( table ref, int callbackId, table callbackFn ) {: .copyable aria-label='Functions' }

### RemoveModData () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### void RemoveModData ( table ref ) {: .copyable aria-label='Functions' }

Deletes the stored "saveX.dat" file if it exists. There are 3 "saveX.dat" files, one per Savegame. They are stored in the mod's folder next to the "main.lua" file. The number indicates the savegame it corresponds to. The number will be determined automatically by the game.

### RenderScaledText () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### void RenderScaledText ( string str, float X, float Y, float ScaleX, float ScaleY, float R, float G, float B, float A ) {: .copyable aria-label='Functions' }

Renders a scaled text on the Screen. X and Y coordinates need to be in screen coordinates ( x\[0,\~500) y \[0,\~350) ). ScaleX, ScaleY, R ,G ,B and A need to be between \[0,1]. Some scale values can cause the font to display deformed and pixelated.

???- example "Example Code" This code renders the player position on the screen.

```lua
    local player = Isaac.GetPlayer(0)
    local pos = player.Position
    Isaac.RenderText("X: "..pos.X.." Y: "..pos.Y, 50, 50, 0.5, 0.5, 1 ,1 ,1 ,1 )
```

### RenderText () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### void RenderText ( string str, float X, float Y, float R, float G, float B, float A ) {: .copyable aria-label='Functions' }

Renders a text with the default size on the Screen. X and Y coordinates need to be in screen coordinates ( x\[0,\~500) y \[0,\~350) ). R,G,B and A need to be between \[0,1].

???- example "Example Code" This code renders the player position on the screen.

```lua
    local player = Isaac.GetPlayer(0)
    local pos = player.Position
    Isaac.RenderText("X: "..pos.X.." Y: "..pos.Y, 50, 50, 1 ,1 ,1 ,1 )
```

### SaveModData () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### void SaveModData ( table ref, string data ) {: .copyable aria-label='Functions' }

Stores a JSON array/table in a "saveX.dat" file. The stored Data persists thruout resets and game restart, so its perfect to store persistent data. There are 3 "saveX.dat" files, one per Savegame. They are stored in the mod's folder next to the "main.lua" file. The number indicates the savegame it corresponds to. The number will be determined automatically by the game.

???- example "Example Code" This code saves a table in the "saveX.dat" file.

```lua
    local yourMod = RegisterMod("someMod", 1)
    local json = require("json")
    -- ...
    --Saving Moddata--
    function yourMod:SaveGame()
    local table= {1,2,3}
    yourMod.SaveData(yourMod, json.encode(table))
    end
    yourMod:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, yourMod.SaveGame)
```

### ScreenToWorld () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) ScreenToWorld ( [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) pos ) {: .copyable aria-label='Functions' }

Transfers Screen (aka. Window coordinates) into Worldcoordinates. This can be used to get a specific location in the room in World coordnates The World coordinate system is x\[0,inf) y\[0,inf).

### ScreenToWorldDistance () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) ScreenToWorldDistance ( [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) pos ) {: .copyable aria-label='Functions' }

### [Spawn](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/RoomConfig_Spawn/README.md) () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### [Entity](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Entity/README.md) [Spawn](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/RoomConfig_Spawn/README.md) ( int entityType, int entityVariant, int entitySubtype, [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) position, [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) velocity, [Entity](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Entity/README.md) Spawner ) {: .copyable aria-label='Functions' }

Spawns the defined entity at the given location. If the position is not free, it spawns it in the nearest free position. There are two spawn functions. [Isaac.Spawn()](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Isaac/README.md#spawn) and [Game():Spawn()](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Game/README.md#spawn). If you need to spawn something with a specific seed, then you use [Game():Spawn()](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Game/README.md#spawn). If you need to spawn something with a randomly generated seed, then use [Isaac.Spawn()](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Isaac/README.md#spawn). Most of the time, you will probably want to use [Isaac.Spawn()](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Isaac/README.md#spawn).

???- example "Example Code" This code spawns a random collectible at in center of the current room.

```lua
    Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, 0, Vector(320,280), Vector(0,0), nil)
```

### WorldToRenderPosition () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) WorldToRenderPosition ( [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) pos ) {: .copyable aria-label='Functions' }

Transfers world (aka. game coordinates) into Rendercoordinates. This can be used to render things at fixed positions in a room. The Render coordinate system is x\[0,inf) y\[0,inf). It defines the Position on the rendering-plane in the current room.

### WorldToScreen () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) WorldToScreen ( [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) pos ) {: .copyable aria-label='Functions' }

Transfers world (aka. game coordinates) into Screen (aka. Window) coordinates. This can be used to render things next to an entity. The Screen coordinate system is x\[0,inf) y\[0,inf). Normally, it goes till \~500x \~300y. The return vector contains integer values or numbers ending with .5

???- example "Example Code" This code render "test" at the position of the player. The text will move with isaac.

```lua
    local player = Isaac.GetPlayer(0)
    local screenpos = Isaac.WorldToScreen(player.Position)    
    Isaac.RenderText("test", screenpos.X, screenpos.Y, 1 ,1 ,1 ,1 )
```

### WorldToScreenDistance () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/isaac.md){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) WorldToScreenDistance ( [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) pos ) {: .copyable aria-label='Functions' }


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moddingofisaac.com/ab_p/beta/docs/isaac.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
