Scripting API
Scripting API
TileShape
Record in Abyss.Core, from Abyss.Core.
What of its cell a tile of a slice fills, as Physics 2D's Tilemap Collider 2D meets it and a Shadow Caster 2D casts from it: the whole cell, what of the slice's art shows — its stair steps straightened up to TileShape.Smoothing pixels — or shapes drawn on it, their corners in the slice's pixels from its top left corner down. Kept with the slice in its image's sidecar, only where it is not Full.
public record TileShapeConstructors
TileShape
public TileShape(TileShapeKind Kind, float Smoothing, IReadOnlyList<IReadOnlyList<Vector2>> Shapes)What of its cell a tile of a slice fills, as Physics 2D's Tilemap Collider 2D meets it and a Shadow Caster 2D casts from it: the whole cell, what of the slice's art shows — its stair steps straightened up to TileShape.Smoothing pixels — or shapes drawn on it, their corners in the slice's pixels from its top left corner down. Kept with the slice in its image's sidecar, only where it is not Full.
Parameters
Kind: Full, Traced or Drawn.Smoothing: Traced: how far from a straight line a corner may be, in pixels, and be straightened.Shapes: Drawn: each shape's corners.
Properties
Kind
public TileShapeKind Kind { get; init; }Full, Traced or Drawn.
Smoothing
public float Smoothing { get; init; }Traced: how far from a straight line a corner may be, in pixels, and be straightened.
Shapes
public IReadOnlyList<IReadOnlyList<Vector2>> Shapes { get; init; }Drawn: each shape's corners.
Full
public static TileShape Full { get; }The whole cell.
Methods
Traced
public static TileShape Traced(float smoothing = 1)What of the slice's art shows, straightened by smoothing pixels.
Parameters
smoothing
Drawn
public static TileShape Drawn(IEnumerable<IEnumerable<Vector2>> shapes)The shapes shapes, each its corners in the slice's pixels from its top left corner down.
Parameters
shapes
Equals
public bool Equals(TileShape? other)Parameters
other
GetHashCode
public override int GetHashCode()Constants
DefaultSmoothing
public const float DefaultSmoothing = 1How far a Traced shape is straightened where its sidecar says nothing: steps of a pixel.
