Class Edges
Definition
Namespace: StardewUI.Layout
Assembly: StardewUI.dll
Describes a set of edge dimensions, e.g. for margin or padding.
Inheritance
Object ⇦ Edges
Implements
IEquatable<Edges>
Members
Constructors
Name | Description |
---|---|
Edges(Int32, Int32, Int32, Int32) | Describes a set of edge dimensions, e.g. for margin or padding. |
Edges(Int32) | Initializes a new Edges with all edges set to the same value. |
Edges(Int32, Int32) | Initialies a new Edges with symmetrical horizontal and vertical values. |
Fields
Properties
Name | Description |
---|---|
Bottom | The bottom edge. |
EqualityContract | |
Horizontal | Gets the total value for all horizontal edges (Left + Right). |
Left | The left edge. |
Right | The right edge. |
Top | The top edge. |
Total | The total size occupied by all edges. |
Vertical | Gets the total value for all vertical edges (Top + Bottom). |
Methods
Name | Description |
---|---|
Equals(Edges) | |
GetHashCode() | (Overrides Object.GetHashCode() ) |
HorizontalOnly() | Gets a copy of this instance with only the horizontal edges set (vertical edges zeroed out). |
Parse(string) | Parses an Edges value from a comma-separated string representation. |
Rotate(SimpleRotation) | Rotates the edges, transposing the individual edge values. |
ToString() | (Overrides Object.ToString() ) |
VerticalOnly() | Gets a copy of this instance with only the vertical edges set (horizontal edges zeroed out). |
Details
Constructors
Edges(int, int, int, int)
Describes a set of edge dimensions, e.g. for margin or padding.
Parameters
Left
Int32
The left edge.
Top
Int32
The top edge.
Right
Int32
The right edge.
Bottom
Int32
The bottom edge.
Edges(int)
Initializes a new Edges with all edges set to the same value.
Parameters
all
Int32
Common value for all edges.
Edges(int, int)
Initialies a new Edges with symmetrical horizontal and vertical values.
Parameters
horizontal
Int32
Common value for the Left and Right edges.
vertical
Int32
Common value for the Top and Bottom edges.
Fields
NONE
An Edges instance with all edges set to zero.
Field Value
Properties
Bottom
The bottom edge.
Property Value
EqualityContract
Property Value
Horizontal
Gets the total value for all horizontal edges (Left + Right).
Property Value
Left
The left edge.
Property Value
Right
The right edge.
Property Value
Top
The top edge.
Property Value
Total
The total size occupied by all edges.
Property Value
Vertical
Gets the total value for all vertical edges (Top + Bottom).
Property Value
Methods
Equals(Edges)
Parameters
other
Edges
Returns
Remarks
Overrides the default implementation to avoid using reflection on every frame during dirty checks.
GetHashCode()
Returns
HorizontalOnly()
Gets a copy of this instance with only the horizontal edges set (vertical edges zeroed out).
Returns
Parse(string)
Parses an Edges value from a comma-separated string representation.
Parameters
value
string
The formatted edges to parse.
Returns
The parsed Edges.
Remarks
The behavior depends on the number of comma-separated tokens in the string, equivalent to the constructor overload with that number of parameters:
- A single value will give all edges the same length
- Two values will set the horizontal (left/right) and vertical (top/bottom) lengths
- Four values will set each length individually
- Any other format will throw FormatException.
Rotate(SimpleRotation)
Rotates the edges, transposing the individual edge values.
Parameters
rotation
SimpleRotation
The rotation type (angle).
Returns
A rotated copy of this Edges instance.
ToString()
Returns
VerticalOnly()
Gets a copy of this instance with only the vertical edges set (horizontal edges zeroed out).