Table of Contents

Struct NineSlice.Thirds

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

Represents the thirds of one axis of a nine slice using a Elements.Core.float4.

public readonly struct NineSlice.Thirds
Inherited Members

Constructors

Thirds(float4)

Creates a new thirds instance using the given edge definition.

public Thirds(float4 edges)

Parameters

edges float4

The edge definition to use.

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.

Exceptions

ArgumentException

When the edges-values aren't monotonically growing.

Properties

Edges

Gets the raw edge definition of these thirds.

public float4 Edges { get; }

Property Value

float4

End

Gets the absolute position of the 3rd third's outer edge.

public float End { get; }

Property Value

float

Length

Gets the absolute length of these thirds from Start to End.

public float Length { get; }

Property Value

float

Middle

Gets the absolute middle position of the 2nd third.

public float Middle { get; }

Property Value

float

Start

Gets the absolute position of the 1st third's outer edge.

public float Start { get; }

Property Value

float

Methods

GetLength(Half)

Gets the absolute length between Start and Middle, or Middle and End.

public float GetLength(Slices.Half half)

Parameters

half Slices.Half

The half to get the length of.

Returns

float

The absolute length of that half.

Exceptions

ArgumentException

When the half-value is invalid.

GetRatio(Half)

Gets the ratio of the 1st third's length to the first half, or the 3rd third's to the second half.

public float GetRatio(Slices.Half half)

Parameters

half Slices.Half

The half to get the ratio for.

Returns

float

The ratio of outer third to half.

Exceptions

ArgumentException

When the half-value is invalid.

GetRatio(Third)

Gets the ratio of a third's length to the total length of these thirds.

public float GetRatio(Slices.Third third)

Parameters

third Slices.Third

The third to get the ratio for.

Returns

float

The ratio of a third to the total.

Exceptions

ArgumentException

When the third-value is invalid.