GraphicsAPI reference
Struct AtlasRegion
Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Graphics2D.dll
Guide: Graphics
One named rectangle of an atlas image, as a packing tool described it.
public readonly struct AtlasRegion : IEquatable<AtlasRegion>Implements
Constructors
AtlasRegion(string, RectF, Vector2, float?)
One named rectangle of an atlas image, as a packing tool described it.
public AtlasRegion(string Name, RectF Source, Vector2 Origin, float? Duration)Parameters
Name string
The frame’s name, without a file extension (“hero_run_0” for “hero_run_0.png”, “slime 0” for Aseprite’s “slime 0.aseprite”).
Source RectF
The rectangle in the atlas image, in pixels.
Origin Vector2
The anchor in the rectangle’s pixels (see Origin): the tool’s pivot when it wrote one, otherwise the Pivot of the untrimmed frame, so trimmed frames line up as their untrimmed originals.
Duration float?
How long the frame shows in an animation, in seconds, when the tool wrote it (Aseprite).
Properties
Duration
How long the frame shows in an animation, in seconds, when the tool wrote it (Aseprite).
public float? Duration { get; init; }Property Value
Name
The frame’s name, without a file extension (“hero_run_0” for “hero_run_0.png”, “slime 0” for Aseprite’s “slime 0.aseprite”).
public string Name { get; init; }Property Value
Origin
The anchor in the rectangle’s pixels (see Origin): the tool’s pivot when it wrote one, otherwise the Pivot of the untrimmed frame, so trimmed frames line up as their untrimmed originals.
public Vector2 Origin { get; init; }Property Value
Source
The rectangle in the atlas image, in pixels.
public RectF Source { get; init; }Property Value
Methods
Deconstruct(out string, out RectF, out Vector2, out float?)
public void Deconstruct(out string Name, out RectF Source, out Vector2 Origin, out float? Duration)Parameters
Name string
Source RectF
Origin Vector2
Duration float?
Equals(object)
public override bool Equals(object obj)Parameters
obj object
Returns
Equals(AtlasRegion)
public bool Equals(AtlasRegion other)Parameters
other AtlasRegion
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(AtlasRegion, AtlasRegion)
public static bool operator ==(AtlasRegion left, AtlasRegion right)Parameters
left AtlasRegion
right AtlasRegion
Returns
operator !=(AtlasRegion, AtlasRegion)
public static bool operator !=(AtlasRegion left, AtlasRegion right)Parameters
left AtlasRegion
right AtlasRegion