Table of Contents

Struct NineSlice

Namespace
MonkeyLoader.Resonite.UI
Assembly
MonkeyLoader.Resonite.Integration.dll

Represents a nine slice with its vertical and horizontalSlices.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

verticalEdges float4

The edges splitting this nine slice vertically into Bottom, Middle, and Top.

horizontalEdges float4

The 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

verticalThirds NineSlice.Thirds

The thirds splitting this nine slice vertically into Bottom, Middle, and Top.

horizontalThirds NineSlice.Thirds

The 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

NineSlice.Thirds

VerticalThirds

Gets the thirds splitting this nine slice vertically into Bottom, Middle, and Top.

public NineSlice.Thirds VerticalThirds { get; }

Property Value

NineSlice.Thirds

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

spriteProvider SpriteProvider

The 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

spriteProvider SpriteProvider

The sprite provider to configure.

horizontal Slices.Horizontal

The 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

spriteProvider SpriteProvider

The sprite provider to configure.

vertical Slices.Vertical

The 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

spriteProvider SpriteProvider

The sprite provider to configure.

vertical Slices.Vertical

The Slices.Vertical slice to use.

horizontal Slices.Horizontal

The Slices.Horizontal slice to use.

Exceptions

ArgumentException

When the vertical-value or horizontal-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

horizontal Slices.Horizontal

The 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

vertical Slices.Vertical

The 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

vertical Slices.Vertical

The Slices.Vertical slice to use.

horizontal Slices.Horizontal

The Slices.Horizontal slice to use.

Returns

float4

The borders for the slice.

Exceptions

ArgumentException

When the vertical-value or horizontal-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

horizontal Slices.Horizontal

The 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

vertical Slices.Vertical

The 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

vertical Slices.Vertical

The Slices.Vertical slice to use.

horizontal Slices.Horizontal

The Slices.Horizontal slice to use.

Returns

Rect

The Elements.Core.Rect for the slice.

Exceptions

ArgumentException

When the vertical-value or horizontal-value is invalid.