Struct NineSlice
- Namespace
- MonkeyLoader.Resonite.UI
- Assembly
- MonkeyLoader.Resonite.Integration.dll
Represents a nine slice with its vertical
and horizontal Slices.Third segments.
Allows getting the Elements.Core.Rect and Borders
for each of the ways to further divide it.
public readonly struct NineSlice
- Inherited Members
Constructors
NineSlice(float4, float4)
Creates a new nine slice instance by converting the given edge definitions into the NineSlice.Thirds of it.
public NineSlice(float4 verticalEdges, float4 horizontalEdges)
Parameters
verticalEdgesfloat4The edges splitting this nine slice vertically into Bottom, Middle, and Top.
horizontalEdgesfloat4The edges splitting this nine slice horizontally into Left, Center, and Right.
Remarks
The Elements.Core.float4's values are to be seen as the absolute positions of the:
Outer edge of 1st third, shared edge of 1st and 2nd third, shared edge of 2nd and 3rd third, and outer edge of 3rd third.
NineSlice(Thirds, Thirds)
Creates a new nine slice instance using the given NineSlice.Thirds.
public NineSlice(NineSlice.Thirds verticalThirds, NineSlice.Thirds horizontalThirds)
Parameters
verticalThirdsNineSlice.ThirdsThe thirds splitting this nine slice vertically into Bottom, Middle, and Top.
horizontalThirdsNineSlice.ThirdsThe thirds splitting this nine slice horizontally into Left, Center, and Right.
Properties
HorizontalThirds
Gets the thirds splitting this nine slice horizontally into Left, Center, and Right.
public NineSlice.Thirds HorizontalThirds { get; }
Property Value
VerticalThirds
Gets the thirds splitting this nine slice vertically into Bottom, Middle, and Top.
public NineSlice.Thirds VerticalThirds { get; }
Property Value
Methods
Configure(SpriteProvider)
Configures the given FrooxEngine.SpriteProvider with the nine slice Elements.Core.Rect and borders using the whole area of the NineSlice.Thirds.
public void Configure(SpriteProvider spriteProvider)
Parameters
spriteProviderSpriteProviderThe sprite provider to configure.
Configure(SpriteProvider, Horizontal)
Configures the given FrooxEngine.SpriteProvider with the nine slice Elements.Core.Rect and borders using the whole vertical area and given horizontal slice of the NineSlice.Thirds.
public void Configure(SpriteProvider spriteProvider, Slices.Horizontal horizontal)
Parameters
spriteProviderSpriteProviderThe sprite provider to configure.
horizontalSlices.HorizontalThe Slices.Horizontal slice to use.
Exceptions
- ArgumentException
When the
horizontal-value is invalid.
Configure(SpriteProvider, Vertical)
Configures the given FrooxEngine.SpriteProvider with the nine slice Elements.Core.Rect and borders using the whole horizontal area and the given vertical slice of the NineSlice.Thirds.
public void Configure(SpriteProvider spriteProvider, Slices.Vertical vertical)
Parameters
spriteProviderSpriteProviderThe sprite provider to configure.
verticalSlices.VerticalThe Slices.Vertical slice to use.
Exceptions
- ArgumentException
When the
vertical-value is invalid.
Configure(SpriteProvider, Vertical, Horizontal)
Configures the given FrooxEngine.SpriteProvider with the nine slice Elements.Core.Rect and borders using the given vertical and horizontal slices of the NineSlice.Thirds.
public void Configure(SpriteProvider spriteProvider, Slices.Vertical vertical, Slices.Horizontal horizontal)
Parameters
spriteProviderSpriteProviderThe sprite provider to configure.
verticalSlices.VerticalThe Slices.Vertical slice to use.
horizontalSlices.HorizontalThe Slices.Horizontal slice to use.
Exceptions
- ArgumentException
When the
vertical-value orhorizontal-value is invalid.
GetBorders()
Gets the nine slice borders using the whole area of the NineSlice.Thirds.
public float4 GetBorders()
Returns
- float4
The borders for the whole area.
GetBorders(Horizontal)
Gets the nine slice borders using the whole vertical area and
given horizontal slice of the NineSlice.Thirds.
public float4 GetBorders(Slices.Horizontal horizontal)
Parameters
horizontalSlices.HorizontalThe Slices.Horizontal slice to use.
Returns
- float4
The borders for the horizontal slice.
Exceptions
- ArgumentException
When the
horizontal-value is invalid.
GetBorders(Vertical)
Gets the nine slice borders using the whole horizontal area and
given vertical slice of the NineSlice.Thirds.
public float4 GetBorders(Slices.Vertical vertical)
Parameters
verticalSlices.VerticalThe Slices.Vertical slice to use.
Returns
- float4
The borders for the vertical slice.
Exceptions
- ArgumentException
When the
vertical-value is invalid.
GetBorders(Vertical, Horizontal)
Gets the nine slice borders using the given vertical and horizontal slices of the NineSlice.Thirds.
public float4 GetBorders(Slices.Vertical vertical, Slices.Horizontal horizontal)
Parameters
verticalSlices.VerticalThe Slices.Vertical slice to use.
horizontalSlices.HorizontalThe Slices.Horizontal slice to use.
Returns
- float4
The borders for the slice.
Exceptions
- ArgumentException
When the
vertical-value orhorizontal-value is invalid.
GetRect()
Gets the nine slice Elements.Core.Rect using the whole area of the NineSlice.Thirds.
public Rect GetRect()
Returns
- Rect
The Elements.Core.Rect for the whole area.
GetRect(Horizontal)
Gets the nine slice Elements.Core.Rect using the whole vertical area and given horizontal slice of the NineSlice.Thirds.
public Rect GetRect(Slices.Horizontal horizontal)
Parameters
horizontalSlices.HorizontalThe Slices.Horizontal slice to use.
Returns
- Rect
The Elements.Core.Rect for the horizontal slice.
Exceptions
- ArgumentException
When the
horizontal-value is invalid.
GetRect(Vertical)
Gets the nine slice Elements.Core.Rect using the whole horizontal area and the given vertical slice of the NineSlice.Thirds.
public Rect GetRect(Slices.Vertical vertical)
Parameters
verticalSlices.VerticalThe Slices.Vertical slice to use.
Returns
- Rect
The Elements.Core.Rect for the vertical slice.
Exceptions
- ArgumentException
When the
vertical-value is invalid.
GetRect(Vertical, Horizontal)
Gets the nine slice Elements.Core.Rect using the given vertical and horizontal slices of the NineSlice.Thirds.
public Rect GetRect(Slices.Vertical vertical, Slices.Horizontal horizontal)
Parameters
verticalSlices.VerticalThe Slices.Vertical slice to use.
horizontalSlices.HorizontalThe Slices.Horizontal slice to use.
Returns
- Rect
The Elements.Core.Rect for the slice.
Exceptions
- ArgumentException
When the
vertical-value orhorizontal-value is invalid.