Expand description
Utility functions used internally by the plugin that have been exposed to the public api.
Functions§
- calculate_
transform_ from_ entity_ instance - Performs
EntityInstance
toTransform
conversion - create_
entity_ definition_ map - Simple conversion from a list of EntityDefinitions to a map using their Uids as the keys.
- create_
layer_ definition_ map - Simple conversion from a list of LayerDefinitions to a map using their Uids as the keys.
- grid_
coords_ to_ ldtk_ grid_ coords - Performs GridCoords to LDtk grid coordinate conversion.
- grid_
coords_ to_ translation - Performs GridCoords to translation conversion, so that the resulting translation is in the the center of the tile.
- grid_
coords_ to_ translation_ relative_ to_ tile_ layer - Performs GridCoords to translation conversion (relative to the layer), so that the resulting translation is in the the center of the tile.
- int_
grid_ index_ to_ grid_ coords - The
int_grid_csv
field of a LayerInstance is a 1-dimensionalVec<i32>
. This function can map the indices of this Vec to a corresponding GridCoords. - ldtk_
grid_ coords_ to_ grid_ coords - Performs LDtk grid coordinate to GridCoords conversion.
- ldtk_
grid_ coords_ to_ translation - Performs LDtk grid coordinate to translation conversion, so that the resulting translation is in the center of the tile.
- ldtk_
grid_ coords_ to_ translation_ relative_ to_ tile_ layer - Performs LDtk grid coordinate to translation conversion, so that the resulting translation is in the center of the tile.
- ldtk_
pixel_ coords_ to_ grid_ coords - Performs LDtk pixel coordinate to GridCoords conversion.
- ldtk_
pixel_ coords_ to_ translation - Performs LDtk pixel coordinate to translation conversion.
- ldtk_
pixel_ coords_ to_ translation_ pivoted - Performs LDtk pixel coordinate to translation conversion, with “pivot” support.
- sprite_
from_ entity_ info - Creates a Sprite from the entity information available to the LdtkEntity::bundle_entity method.
- sprite_
sheet_ from_ entity_ info - Creates a
Sprite
withTextureAtlas
from the entity information available to the LdtkEntity::bundle_entity method. - translation_
to_ grid_ coords - Performs translation to GridCoords conversion.
- translation_
to_ ldtk_ pixel_ coords - Performs translation to LDtk pixel coordinate conversion.