tModLoader  0.12 Alpha
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. More...
 
int DirectionOffset
 Length of the entity position offset applied in the X direction based on targetDirection. More...
 
Vector2 FinalOffset
 Offset applied to the final anchor position. Use with caution, vanilla does not utilize it! More...
 
Entity RestingEntity
 The resting entity (Player or NPC). Can be null if not available from the context. More...
 
int TargetDirection
 Direction the entity is facing while resting. More...
 
Vector2 VisualOffset
 The visual offset of the entity, not affecting any logic. More...
 

Detailed Description

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

Member Data Documentation

◆ AnchorTilePosition

Point Terraria.DataStructures.TileRestingInfo.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.

◆ DirectionOffset

int Terraria.DataStructures.TileRestingInfo.DirectionOffset

Length of the entity position offset applied in the X direction based on targetDirection.

◆ FinalOffset

Vector2 Terraria.DataStructures.TileRestingInfo.FinalOffset

Offset applied to the final anchor position. Use with caution, vanilla does not utilize it!

◆ RestingEntity

Entity Terraria.DataStructures.TileRestingInfo.RestingEntity

The resting entity (Player or NPC). Can be null if not available from the context.

◆ TargetDirection

int Terraria.DataStructures.TileRestingInfo.TargetDirection

Direction the entity is facing while resting.

◆ VisualOffset

Vector2 Terraria.DataStructures.TileRestingInfo.VisualOffset

The visual offset of the entity, not affecting any logic.