GraphicsAPI reference
Struct DrawOptions
Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Graphics2D.dll
Guide: Graphics
Per-draw sprite options. Origin is in source pixels and is also the rotation pivot.
public readonly struct DrawOptions : IEquatable<DrawOptions>Implements
Constructors
DrawOptions(bool, bool, float, Vector2, Vector2?)
Per-draw sprite options. Origin is in source pixels and is also the rotation pivot.
public DrawOptions(bool FlipX = false, bool FlipY = false, float Rotation = 0, Vector2 Origin = default, Vector2? Scale = null)Parameters
FlipX bool
Mirrors the sprite horizontally.
FlipY bool
Mirrors the sprite vertically.
Rotation float
Clockwise rotation in radians around Origin.
Origin Vector2
Rotation and scale pivot, in source pixels from the top-left of the source rectangle.
Scale Vector2?
Scale factors per axis; null draws at 1:1.
Fields
None
No flip, rotation or scale: the same as default.
public static readonly DrawOptions NoneField Value
Properties
FlipX
Mirrors the sprite horizontally.
public bool FlipX { get; init; }Property Value
FlipY
Mirrors the sprite vertically.
public bool FlipY { get; init; }Property Value
Origin
Rotation and scale pivot, in source pixels from the top-left of the source rectangle.
public Vector2 Origin { get; init; }Property Value
Rotation
Clockwise rotation in radians around Origin.
public float Rotation { get; init; }Property Value
Scale
Scale factors per axis; null draws at 1:1.
public Vector2? Scale { get; init; }Property Value
Methods
Deconstruct(out bool, out bool, out float, out Vector2, out Vector2?)
public void Deconstruct(out bool FlipX, out bool FlipY, out float Rotation, out Vector2 Origin, out Vector2? Scale)Parameters
FlipX bool
FlipY bool
Rotation float
Origin Vector2
Scale Vector2?
Equals(object)
public override bool Equals(object obj)Parameters
obj object
Returns
Equals(DrawOptions)
public bool Equals(DrawOptions other)Parameters
other DrawOptions
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(DrawOptions, DrawOptions)
public static bool operator ==(DrawOptions left, DrawOptions right)Parameters
left DrawOptions
right DrawOptions
Returns
operator !=(DrawOptions, DrawOptions)
public static bool operator !=(DrawOptions left, DrawOptions right)Parameters
left DrawOptions
right DrawOptions