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
float4The 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
Length
public float Length { get; }
Property Value
Middle
Gets the absolute middle position of the 2nd third.
public float Middle { get; }
Property Value
Start
Gets the absolute position of the 1st third's outer edge.
public float Start { get; }
Property Value
Methods
GetLength(Half)
public float GetLength(Slices.Half half)
Parameters
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
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
Returns
- float
The ratio of a third to the total.
Exceptions
- ArgumentException
When the
third
-value is invalid.