TileDefs are Assets that store information about tile definitions. They behave similar to classes in an object-oriented paradigm.
The TileDef class is defined as:
public class TileDef : Asset, IVarsAndComponentsModel
{
public char Char { get; set; }
public string? Script { get; set; }
public TileAnimation? Animation { get; set; }
public bool OverrideSize { get; set; }
public int OverrideWidth { get; set; }
public int OverrideHeight { get; set; }
public int OffsetX { get; set; }
public int OffsetY { get; set; }
public int RowSpan { get; set; } = 1;
public int ColSpan { get; set; } = 1;
public uint BackgroundColor { get; set; }
public uint TintColor { get; set; } = 0xFFFFFFFF;
public string? Text { get; set; }
public Variable[]? Variables { get; set; }
public DataComponent[]? DataComponents { get; set; }
public TileCollisionMode CollisionMode { get; set; }
public TileFlags TileFlags { get; set; }
public PhysicsSimulationMode PhysicsSimulationMode { get; set; }
public float GravityMultiplierX { get; set; }
public float GravityMultiplierY { get; set; }
public int[]? Tags { get; set; }
public int LayerId { get; set; }
public RectF ColliderPadding { get; set; }
}
public enum TileCollisionMode
{
None = 0,
Solid = 1,
Trigger = 2,
OneWay = 3,
OptimizedWall = 4
}
public enum TileCollisionOverride
{
Default = 0,
Ignore = 2,
Wall = 1,
OptimizedWall = 3
}
public enum PhysicsSimulationMode
{
None,
Static,
Kinematic,
Dynamic
}
[Flags]
public enum TileFlags
{
None = 0,
Player = 1,
Type0 = 1 << 2,
Type1 = 1 << 3,
Type2 = 1 << 4,
Type3 = 1 << 5,
Type4 = 1 << 6,
Disregard = 1 << 7,
NamedTileDef = 1 << 8,
Preserve = 1 << 9,
GenerateId = 1 << 10,
CanRotate = 1 << 11,
PositionLockX = 1 << 12,
PositionLockY = 1 << 13,
Simulate = 1 << 14,
SpriteAutoSizeOff = 1 << 15,
MimicSize = 1 << 16,
Save = 1 << 17 | GenerateId,
MimicCollider = 1 << 18,
Reserved8 = 1 << 19,
Reserved9 = 1 << 20,
Reserved10 = 1 << 21,
Reserved11 = 1 << 22,
Reserved12 = 1 << 23,
Reserved13 = 1 << 24,
BlockHint = 1 << 25,
CameraCorner = BlockHint | Type2,
KiloTexture = 1 << 26,
OptimizedWall = KiloTexture,
CloneTileDef = 1 << 27,
Annotation = 1 << 28,
CameraTarget = 1 << 29,
}
See Also: