tModLoader v2023.01
A mod to make and play Terraria mods
Terraria.DataStructures.TileRestingInfo Struct Reference

Holds data required for offsetting an entity when it rests on a tile (sitting/sleeping). More...

Public Member Functions

 TileRestingInfo (Entity restingEntity, Point anchorTilePosition, Vector2 visualOffset, int targetDirection, int directionOffset=0, Vector2 finalOffset=default)
 
void Deconstruct (out Entity restingEntity, out Point anchorTilePosition, out Vector2 visualOffset, out int targetDirection, out int directionOffset, out Vector2 finalOffset)
 

Public Attributes

Point AnchorTilePosition
 The bottom-most position of the resting tile in tile coordinates, affecting logic for resetting (invalid) resting state and used to align the hitbox.
 
int DirectionOffset
 Length of the entity position offset applied in the X direction based on targetDirection.
 
Vector2 FinalOffset
 Offset applied to the final anchor position. Use with caution, vanilla does not utilize it!
 
Entity RestingEntity
 The resting entity (Player or NPC). Can be null if not available from the context.
 
int TargetDirection
 Direction the entity is facing while resting.
 
Vector2 VisualOffset
 The visual offset of the entity, not affecting any logic.
 

Detailed Description

Holds data required for offsetting an entity when it rests on a tile (sitting/sleeping).