GraphicsAPI reference
Struct NineSlice
Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Graphics2D.dll
Guide: Graphics
An image that stretches to any size without distorting its frame: the part of Source within Left, Top, Right and Bottom pixels of its sides is the border, drawn at its size at the corners and stretched along the edges; the rest is the centre, stretched to fill. Draw one with DrawNineSlice, or set it as a Image.
public readonly struct NineSlice : IEquatable<NineSlice>Implements
Constructors
NineSlice(Texture, RectF, float, float, float, float)
An image that stretches to any size without distorting its frame: the part of Source within Left, Top, Right and Bottom pixels of its sides is the border, drawn at its size at the corners and stretched along the edges; the rest is the centre, stretched to fill. Draw one with DrawNineSlice, or set it as a Image.
public NineSlice(Texture Texture, RectF Source, float Left, float Top, float Right, float Bottom)Parameters
Texture Texture
The texture that holds the image.
Source RectF
The image’s rectangle in the texture, in pixels.
Left float
Width of the left border, in source pixels.
Top float
Height of the top border, in source pixels.
Right float
Width of the right border, in source pixels.
Bottom float
Height of the bottom border, in source pixels.
NineSlice(Texture, RectF, float)
An image with a border of border pixels on every side.
public NineSlice(Texture texture, RectF source, float border)Parameters
texture Texture
source RectF
border float
Properties
Bottom
Height of the bottom border, in source pixels.
public float Bottom { get; init; }Property Value
Left
Width of the left border, in source pixels.
public float Left { get; init; }Property Value
Right
Width of the right border, in source pixels.
public float Right { get; init; }Property Value
Scale
How many destination units one source pixel of the border takes (1 by default); 2 draws the frame twice as thick.
public float Scale { get; init; }Property Value
Source
The image’s rectangle in the texture, in pixels.
public RectF Source { get; init; }Property Value
Texture
The texture that holds the image.
public Texture Texture { get; init; }Property Value
Top
Height of the top border, in source pixels.
public float Top { get; init; }Property Value
Methods
Deconstruct(out Texture, out RectF, out float, out float, out float, out float)
public void Deconstruct(out Texture Texture, out RectF Source, out float Left, out float Top, out float Right, out float Bottom)Parameters
Texture Texture
Source RectF
Left float
Top float
Right float
Bottom float
Equals(object)
public override bool Equals(object obj)Parameters
obj object
Returns
Equals(NineSlice)
public bool Equals(NineSlice other)Parameters
other NineSlice
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(NineSlice, NineSlice)
public static bool operator ==(NineSlice left, NineSlice right)Parameters
left NineSlice
right NineSlice
Returns
operator !=(NineSlice, NineSlice)
public static bool operator !=(NineSlice left, NineSlice right)Parameters
left NineSlice
right NineSlice