Thickness Struct
Namespace: Stride.UIAssembly: Stride.UI.dll
Describes the thickness of a frame around a cuboid. Six float values describe the Left, Top, Right, Bottom, Front, and Back sides of the cuboid, respectively.
[DataContract("Thickness")]
[DataStyle(DataStyle.Compact)]
public struct Thickness : IEquatable<Thickness>
| Name | Description | |
|---|---|---|
| Constructors | ||
| Thickness(Single, Single, Single, Single) | Initializes a new instance of the Thickness structure that has specific lengths applied to each side of the rectangle. |
|
| Thickness(Single, Single, Single, Single, Single, Single) | Initializes a new instance of the Thickness structure that has specific lengths applied to each side of the cuboid. |
|
| Fields | ||
| Back | The Back side of the bounding cuboid. |
|
| Bottom | The bottom side of the bounding rectangle or cuboid. |
|
| Front | The front side of the bounding cuboid. |
|
| Left | The left side of the bounding rectangle or cuboid. |
|
| Right | The right side of the bounding rectangle or cuboid. |
|
| Top | The upper side of the bounding rectangle or cuboid. |
|
| Properties | ||
| Item[Int32] | Gets the component at the specified index. |
|
| Methods | ||
| Equals(Thickness) | ||
| Equals(Object) | ||
| GetHashCode() | ||
| UniformCuboid(Single) | Initializes a new instance of the Thickness structure that has the specified uniform length on the Left, Right, Top, Bottom, Front, and Back side. |
|
| UniformRectangle(Single) | Initializes a new instance of the Thickness structure that has the specified uniform length on the Left, Right, Top, Bottom side and 0 for the Front and Back side. |
|
| Operators | ||
| Addition(Thickness, Thickness) | Adds two Thickness together. |
|
| Division(Thickness, Single) | Divides a Thickness by a float. |
|
| Equality(Thickness, Thickness) | ||
| Inequality(Thickness, Thickness) | ||
| Multiply(Thickness, Single) | Multiplies a Thickness by a float. |
|
| Subtraction(Thickness, Thickness) | Substracts one Thickness with another. |
|
| UnaryNegation(Thickness) | Reverses the direction of a given Thickness. |
|
Constructors
Thickness(Single, Single, Single, Single)
Initializes a new instance of the Thickness structure that has specific lengths applied to each side of the rectangle.
public Thickness(float left, float top, float right, float bottom)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | left | The thickness for the left side of the rectangle. |
| System.Single | top | The thickness for the upper side of the rectangle. |
| System.Single | right | The thickness for the right side of the rectangle |
| System.Single | bottom | The thickness for the lower side of the rectangle. |
Thickness(Single, Single, Single, Single, Single, Single)
Initializes a new instance of the Thickness structure that has specific lengths applied to each side of the cuboid.
public Thickness(float left, float top, float back, float right, float bottom, float front)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | left | The thickness for the left side of the cuboid. |
| System.Single | top | The thickness for the upper side of the cuboid. |
| System.Single | back | The thickness for the Back side of the cuboid. |
| System.Single | right | The thickness for the right side of the cuboid |
| System.Single | bottom | The thickness for the lower side of the cuboid. |
| System.Single | front | The thickness for the front side of the cuboid. |
Fields
Back
The Back side of the bounding cuboid.
[DataMember(2)]
public float Back
Field Value
| Type | Description |
|---|---|
| System.Single |
Bottom
The bottom side of the bounding rectangle or cuboid.
[DataMember(4)]
public float Bottom
Field Value
| Type | Description |
|---|---|
| System.Single |
Front
The front side of the bounding cuboid.
[DataMember(5)]
public float Front
Field Value
| Type | Description |
|---|---|
| System.Single |
Left
The left side of the bounding rectangle or cuboid.
[DataMember(0)]
public float Left
Field Value
| Type | Description |
|---|---|
| System.Single |
Right
The right side of the bounding rectangle or cuboid.
[DataMember(3)]
public float Right
Field Value
| Type | Description |
|---|---|
| System.Single |
Top
The upper side of the bounding rectangle or cuboid.
[DataMember(1)]
public float Top
Field Value
| Type | Description |
|---|---|
| System.Single |
Properties
Item[Int32]
Gets the component at the specified index.
public readonly float this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The index of the component to access. Use 0 for the Left component, 1 for the Top component, 2 for the Front component, 3 for the Right component, 4 for the Bottom component, 5 for the Back component. |
Property Value
| Type | Description |
|---|---|
| System.Single | The value of the component at the specified index. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | Thrown when the |
Methods
Equals(Thickness)
public bool Equals(Thickness other)
Parameters
| Type | Name | Description |
|---|---|---|
| Thickness | other |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Equals(Object)
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Overrides
GetHashCode()
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
UniformCuboid(Single)
Initializes a new instance of the Thickness structure that has the specified uniform length on the Left, Right, Top, Bottom, Front, and Back side.
public static Thickness UniformCuboid(float thickness)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | thickness | The uniform length applied to all six sides of the bounding cuboid. |
Returns
| Type | Description |
|---|---|
| Thickness | The created thickness class |
UniformRectangle(Single)
Initializes a new instance of the Thickness structure that has the specified uniform length on the Left, Right, Top, Bottom side and 0 for the Front and Back side.
public static Thickness UniformRectangle(float thickness)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | thickness | The uniform length applied to all four sides of the bounding rectangle. |
Returns
| Type | Description |
|---|---|
| Thickness | The created thickness class |
Operators
Addition(Thickness, Thickness)
Adds two Thickness together.
public static Thickness operator +(Thickness value1, Thickness value2)
Parameters
| Type | Name | Description |
|---|---|---|
| Thickness | value1 | The first thickness to add. |
| Thickness | value2 | The second thickness to add. |
Returns
| Type | Description |
|---|---|
| Thickness | A Thickness representing the sum of the two Thickness. |
Division(Thickness, Single)
Divides a Thickness by a float.
public static Thickness operator /(Thickness value1, float value2)
Parameters
| Type | Name | Description |
|---|---|---|
| Thickness | value1 | The thickness. |
| System.Single | value2 | The float value to divide by. |
Returns
| Type | Description |
|---|---|
| Thickness | The divided thickness |
Equality(Thickness, Thickness)
public static bool operator ==(Thickness left, Thickness right)
Parameters
| Type | Name | Description |
|---|---|---|
| Thickness | left | |
| Thickness | right |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Inequality(Thickness, Thickness)
public static bool operator !=(Thickness left, Thickness right)
Parameters
| Type | Name | Description |
|---|---|---|
| Thickness | left | |
| Thickness | right |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Multiply(Thickness, Single)
Multiplies a Thickness by a float.
public static Thickness operator *(Thickness value1, float value2)
Parameters
| Type | Name | Description |
|---|---|---|
| Thickness | value1 | The thickness. |
| System.Single | value2 | The float value to multiply with. |
Returns
| Type | Description |
|---|---|
| Thickness | The multiplied thickness |
Subtraction(Thickness, Thickness)
Substracts one Thickness with another.
public static Thickness operator -(Thickness value1, Thickness value2)
Parameters
| Type | Name | Description |
|---|---|---|
| Thickness | value1 | The thickness to subtract from. |
| Thickness | value2 | The thickness to substract. |
Returns
| Type | Description |
|---|---|
| Thickness | A Thickness representing the difference between the two Thickness. |
UnaryNegation(Thickness)
Reverses the direction of a given Thickness.
public static Thickness operator -(Thickness value)
Parameters
| Type | Name | Description |
|---|---|---|
| Thickness | value | The Thickness to negate. |
Returns
| Type | Description |
|---|---|
| Thickness | A Thickness with the opposite direction. |