Struct Margins
Value-type, never shared between different FlexItems
NOTE: this was a side-effect-free class up until v4.0.x added a fully automatic 'detect changes to any data, and automatically relayout, always 100% correctly' feature; that feature forces the sub-properties of this class to need to delegate to informing the owning FlexItem "I changed; trigger a relayout!"
Implements
Namespace: NinjaTools.FlexBuilder.CSS3
Assembly: cs.temp.dll.dll
Syntax
[Serializable]
public struct Margins : IEnumerable<LengthOrAuto>
Constructors
- (void) Margins(LengthOrAuto)
- (void) Margins(LengthOrAutoType)
Creates a set of margins all in the same mode (pixels or percent or auto .. etc)
Parameters
LengthOrAutoType | mode |
- (void) Margins(Single)
- (void) Margins(Single, Single)
Fields
Properties
- (Margins) Auto
Shorthand for creating a default CSS3 value of 'auto margins'
- (Boolean) EitherHorizontalIsAuto
- (Boolean) EitherVerticalIsAuto
- (Margins) None
Shorthand for creating a default CSS3 value of 'no margins' (technically: sets them all to '0 pixels')
- (Boolean) requiresParentSizeToResolve
Calculates whether ALL values are a standalone value (eg all are pixel values) or ANY require extra context info (eg one or more are percent values)
Methods
- (Nullable<Single>)
BottomOrNull(Nullable)
- (Single)
BottomOrZero(Nullable)
- (Single) BottomOrZero(Vector2)
- (Boolean) Equals(Object)
- (IEnumerator<LengthOrAuto>) GetEnumerator()
- (Int32) GetHashCode()
- (MarginValue) HorizontalValue(CSSAvailableLength)
- (Nullable<Single>) HorizontalValueOrNull(CSSAvailableLength)
- (Nullable<Single>)
HorizontalValueOrNull(Nullable)
- (Nullable<Single>)
HorizontalValueOrNull(Nullable)
- (Single)
HorizontalValueOrZero(Nullable)
- (Single)
HorizontalValueOrZero(Nullable)
- (Single) HorizontalValueOrZero(Single)
- (Single) HorizontalValueOrZero(Vector2)
- (Nullable<Single>)
LeftOrNull(Nullable)
- (Single)
LeftOrZero(Nullable)
- (Single) LeftOrZero(Vector2)
- (Boolean) RequiresParentSizeToResolve(RectTransform.Axis)
As for requiresParentSizeToResolve but applied selectively to either the top/bottom or left/right only
Parameters
RectTransform.Axis | axis |
Returns
Boolean |
- (Nullable<Single>)
RightOrNull(Nullable)
- (Single)
RightOrZero(Nullable)
- (Single) RightOrZero(Vector2)
- (void) Set(Single)
- (void) Set(Single, Single)
Sets the top/bottom margins to one value, and the left/right margins to another value
Parameters
Single | topBottom | |
Single | leftRight |