Struct LengthOrAuto
Margins, Widths, and Heights use a modified version of Length that has the extra option of 'AUTO', maintaining type safety and ensuring e.g. widths dont get mis-used as max-widths. Otherwise this is identical to Length
Namespace: NinjaTools.FlexBuilder.CSS3
Assembly: cs.temp.dll.dll
Syntax
[Serializable]
public struct LengthOrAuto
Constructors
- (void) LengthOrAuto(LengthOrAutoType)
- (void) LengthOrAuto(Boolean)
Failigs in Microsoft's C# (not fixed until C# v8 or so) require a parameter here that does literally nothing
Parameters
Boolean | fakeArgument |
- (void) LengthOrAuto(Single)
- (void) LengthOrAuto(Single, LengthOrAutoType)
Fields
- (LengthOrAutoType) mode
Internal, do NOT modify directly - this is only public because C# doesnt have a 'package' keyword
- (Single) value
Internal, do NOT modify directly - this is only public because C# doesnt have a 'package' keyword
Properties
- (LengthOrAuto) Auto
Shorthand for creating a new struct with the default value explicitly (C# doesn't fully support struct-constructors)
- (Boolean) hasDeclaredValue
This is identical to 'is the CSS value different from 'AUTO'?'
- (Boolean) hasNonRelativeValue
- (Boolean) hasRelativeValue
See hasRelativeValue
Methods
- (BoxLength) Clamp(Length, LengthOrNone, BoxLength, CSSAvailableLength)
Parameters
Length | min | |
LengthOrNone | max | |
BoxLength | length | |
CSSAvailableLength | containerSize |
Returns
BoxLength |
- (Single) Clamp(Length, LengthOrNone, Single, RectTransform.Axis, CSSAvailableSpace)
Clamps this value between a 'min-width' or 'min-height' and a 'max-width' or 'max-height', using the specified axis (vertical or horizontal) to read the correct values (width or height) from the parent's size.
Where possible use
Parameters
Length | min | |
LengthOrNone | max | |
Single | length | |
RectTransform.Axis | axis | |
CSSAvailableSpace | containerSize |
Returns
Single |
- (Single) Clamp(Length, LengthOrNone, Single, RectTransform.Axis, ContentLength)
Clamps this value between a 'min-width' or 'min-height' and a 'max-width' or 'max-height', using the specified axis (vertical or horizontal) to read the correct values (width or height) from the parent's size.
Parameters
Length | min | |
LengthOrNone | max | |
Single | length | |
RectTransform.Axis | axis | |
ContentLength | containerSize |
Returns
Single |
- (Single) Clamp(Single, Single, Single)
- (Boolean) Equals(Object)
- (Int32) GetHashCode()
- (Boolean) HasNonRelativeValue(out BoxLength)
- (Boolean) HasNonRelativeValue(out Single)
- (Boolean) HasResolvableValue(CSSAvailableLength, out BoxLength)
- (Boolean) HasResolvableValue(CSSAvailableLength, out Single)
- (Boolean) HasResolvableValue(ContentLength, out BoxLength)
- (Boolean) HasResolvableValue(ContentLength, out Single)
Based on hasResolvableValue(ContentLength, out Single), but in layout cases you often instead
want to use
Parameters
ContentLength | parentSize | |
Single | resolvedValue |
Returns
Boolean |
- (Boolean)
hasResolvableValue(Nullable)
- (String) ToString()
- (Single) ValueNonRelative()
- (Nullable<Single>) ValueOrNull(CSSAvailableLength)
Upgraded / preferred / future version of ValueOrNull(Nullable<Single>)
Parameters
CSSAvailableLength | containerLength |
Returns
Nullable<Single> |