Repository navigation
API Interop
API reference · generated by
tools/docs/ApiReference, do not edit by hand
How C# reaches the mobile game: handles to game objects, collections and hook helpers. All of it is only in Bunny Loader, because tModLoader runs on the game's own objects.
struct BunnyLoader.Interop.GameArray : IGameObject · only in Bunny Loader
An array of the game, such as Main.npc. Index it as a C# array. foreach and LINQ work over a copy, so use for in code that runs every frame.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
IntPtr Pointer |
field | only here | The array's address in the game. |
new GameArray(IntPtr pointer) |
constructor | only here | Creates an instance. |
GameArray<T> New(GameClass element, int length) |
static method | only here | Creates an array of the game with this element class. |
GameArray<T> Resized(int length) |
method | only here | A new array of this length, with the same content. |
bool IsNull |
property | only here | Whether there is no array. |
int Length |
property | only here | How many it holds. |
ref T this[int index] |
indexer | only here | A reference to one element. Throws when out of range. |
Span<T> AsSpan() |
method | only here | The content as a Span, without copying. |
Span<T>.Enumerator GetEnumerator() |
method | only here | Walks the items in foreach. |
struct BunnyLoader.Interop.GameArray2D : IGameObject · only in Bunny Loader
A two-dimensional array of the game.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
IntPtr Pointer |
field | only here | The array's address in the game. |
new GameArray2D(IntPtr pointer) |
constructor | only here | Creates an instance. |
bool IsNull |
property | only here | Whether there is no array. |
int GetLength(int dimension) |
method | only here | The length of one dimension. |
ref T this[int i, int j] |
indexer | only here | Reads or writes one entry. |
class BunnyLoader.Interop.GameClass · only in Bunny Loader
A class of the game by namespace and name, to create arrays of it.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
new GameClass(string ns, string name, string nested) |
constructor | only here | Creates an instance. |
string FullName |
property | only here | The class's full name in the game. |
IntPtr Handle |
property | only here | The class's address in the game. |
struct Terraria.IO.GameConfiguration
What Bunny Loader adds to the game's settings file.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
T Get<T>(string entry) |
method | same | Reads a value of the world generation's settings. |
struct BunnyLoader.Interop.GameDictionary · only in Bunny Loader
A Dictionary of the game. Wrap the field: new GameDictionary(field).
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
new GameDictionary(IntPtr dictionary) |
constructor | only here | Creates an instance. |
new GameDictionary(GameObject dictionary) |
constructor | only here | Creates an instance. |
bool IsNull |
property | only here | Whether there is no dictionary. |
int Count |
property | only here | How many items it holds. |
bool TryGetValue<TKey, TValue>(TKey key, out TValue value) |
method | only here | Reads an entry if there is one. |
bool ContainsKey<TKey>(TKey key) |
method | only here | Whether there is an entry for this key. |
void Set<TKey, TValue>(TKey key, TValue value) |
method | only here | Writes one entry. |
KeyValuePair<int, int>[] IntEntries() |
method | only here | Copies an int to int dictionary. |
bool Remove<TKey>(TKey key) |
method | only here | Removes an entry. |
class BunnyLoader.Interop.GameException : Exception · only in Bunny Loader
An exception thrown by the game's code, carried into C#.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
new GameException(string message) |
constructor | only here | Creates an instance. |
class BunnyLoader.Interop.GameHandle : IDisposable · only in Bunny Loader
Holds a game object so the game's garbage collector keeps it. Needed for any object you keep past the current call.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
new GameHandle(IntPtr obj) |
constructor | only here | Creates an instance. |
IntPtr Target |
property | only here | The object, kept safe from the game's garbage collector while the handle lives. |
void Dispose() |
method | only here | Lets the object go. |
struct BunnyLoader.Interop.GameList · only in Bunny Loader
A List of the game. Wrap the field: new GameList(field).
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
new GameList(IntPtr list) |
constructor | only here | Creates an instance. |
new GameList(GameObject list) |
constructor | only here | Creates an instance. |
bool IsNull |
property | only here | Whether there is no list. |
int Count |
property | only here | How many items it holds. |
IntPtr this[int index] |
indexer | only here | Reads or writes one entry. |
T Get<T>(int index) |
method | only here | Reads one element as T. |
bool Contains<T>(T value) |
method | only here | Whether it holds this value. |
void Add(IntPtr item) |
method | only here | Adds at the end. |
void Add<T>(T item) |
method | only here | Adds at the end. |
void Insert(int index, IntPtr item) |
method | only here | Adds at a position. |
int IndexOf(IntPtr item) |
method | only here | The position of an object, or -1. |
void RemoveAt(int index) |
method | only here | Removes one by position. |
static class Terraria.GameListExtensions · only in Bunny Loader
Helper for List<int> fields of the game, through GameObject.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
void Add(this GameObject list, int value) |
static method | only here | Adds an int to a game list. |
struct BunnyLoader.Interop.GameNullable · only in Bunny Loader
int? and friends of the game. HasValue and Value work as in C#.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
new GameNullable(T value) |
constructor | only here | Creates an instance. |
bool HasValue |
property | only here | Whether it has a value. |
T Value |
property | only here | The value. Throws when it has none. |
T GetValueOrDefault(T fallback) |
method | only here | The value, or this fallback. |
string ToString() |
override | only here | The text form of this value. |
struct BunnyLoader.Interop.GameObject : IGameObject · only in Bunny Loader
Any object of the game, as a pointer. IsNull says if it is empty.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
IntPtr Pointer |
field | only here | The object's address in the game. |
new GameObject(IntPtr pointer) |
constructor | only here | Creates an instance. |
bool IsNull |
property | only here | Whether there is no object. |
string ClassName |
property | only here | The object's class name. |
bool Equals(GameObject other) |
method | only here | Whether both hold the same value. |
bool Equals(object obj) |
override | only here | Whether both hold the same value. |
int GetHashCode() |
override | only here | The hash of this value. |
string ToString() |
override | only here | The text form of this value. |
struct BunnyLoader.Interop.GameString : IGameObject · only in Bunny Loader
A string of the game. It converts to and from a C# string by itself.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
IntPtr Pointer |
field | only here | The string's address in the game. |
new GameString(IntPtr pointer) |
constructor | only here | Creates an instance. |
bool IsNull |
property | only here | Whether there is no string. |
int Length |
property | only here | How many characters it has. |
string ToString() |
override | only here | The text form of this value. |
string Read(IntPtr str) |
static method | only here | A C# string from a string of the game. |
IntPtr New(string value) |
static method | only here | A string of the game from a C# string, as an address. |
GameString From(string value) |
static method | only here | A GameString from a C# string. |
class Terraria.ModLoader.GameTipData
Wrapper class for a LocalizedText and visibility field that has intended use with modification of Game Tips.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
LocalizedText TipText |
property | same | The text of the tip. |
Mod Mod |
property | same | The mod instance this tip belongs to. This value is null for vanilla tips. |
string Name |
property | same | Retrieves the "name" of this GameTip, which is the Key excluding the beginning Mods.ModName.GameTips portion. For example, if the key was "Mods.ExampleMod.GameTips.ExampleTip", this would return "ExampleTip". |
string FullName |
property | same | Retrieves the FULL "name" of this GameTip, which includes the Mod and this tip's Name. For example, if this tip was from ExampleMod and was named "ExampleTip", this would return "ExampleMod/ExampleTip" |
new GameTipData(LocalizedText text, Mod mod) |
constructor | same | Creates an instance. |
void Hide() |
method | same | Until reload, prevents this tip from ever appearing during loading screens. |
static class Terraria.ModLoader.GameTipID
Numbers of the game's tips. Only two have a name here. tModLoader names all of them.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
int BloodMoonZombieDoorOpening |
static field | same | "During a Blood Moon, Zombies can open doors." |
int SolarEclipseCreepyMonsters |
static field | same | "During a Solar Eclipse, be on the lookout for tons of strange and creepy monsters." |
interface BunnyLoader.Interop.IGameObject · only in Bunny Loader
Every type that wraps a game object, with its Pointer.
| Member | Kind | tModLoader | What it does |
|---|---|---|---|
IntPtr Pointer |
hook | only here | The object's address in the game. |
Bunny Loader wiki ·
Discord ·
Repository ·
BL Editor
Written for Bunny Loader 0.5.5-beta and Terraria Mobile 1.4.5.8.6.
Bunny Loader is not affiliated with Re-Logic or 505 Games.
