Table of Contents

Struct Thickness

Namespace
Stride.UI
Assembly
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>
Implements
Inherited Members

Constructors

Thickness(float, float, float, float)

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

left float

The thickness for the left side of the rectangle.

top float

The thickness for the upper side of the rectangle.

right float

The thickness for the right side of the rectangle

bottom float

The thickness for the lower side of the rectangle.

Thickness(float, float, float, float, float, float)

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

left float

The thickness for the left side of the cuboid.

top float

The thickness for the upper side of the cuboid.

back float

The thickness for the Back side of the cuboid.

right float

The thickness for the right side of the cuboid

bottom float

The thickness for the lower side of the cuboid.

front float

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

float

Bottom

The bottom side of the bounding rectangle or cuboid.

[DataMember(4)]
public float Bottom

Field Value

float

Front

The front side of the bounding cuboid.

[DataMember(5)]
public float Front

Field Value

float

Left

The left side of the bounding rectangle or cuboid.

[DataMember(0)]
public float Left

Field Value

float

Right

The right side of the bounding rectangle or cuboid.

[DataMember(3)]
public float Right

Field Value

float

Top

The upper side of the bounding rectangle or cuboid.

[DataMember(1)]
public float Top

Field Value

float

Properties

this[int]

Gets the component at the specified index.

public float this[int index] { get; }

Parameters

index int

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

float

The value of the component at the specified index.

Exceptions

ArgumentOutOfRangeException

Thrown when the index is out of the range [0, 5].

Methods

Equals(Thickness)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Thickness other)

Parameters

other Thickness

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

UniformCuboid(float)

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

thickness float

The uniform length applied to all six sides of the bounding cuboid.

Returns

Thickness

The created thickness class

UniformRectangle(float)

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

thickness float

The uniform length applied to all four sides of the bounding rectangle.

Returns

Thickness

The created thickness class

Operators

operator +(Thickness, Thickness)

Adds two Thickness together.

public static Thickness operator +(Thickness value1, Thickness value2)

Parameters

value1 Thickness

The first thickness to add.

value2 Thickness

The second thickness to add.

Returns

Thickness

A Thickness representing the sum of the two Thickness.

operator /(Thickness, float)

Divides a Thickness by a float.

public static Thickness operator /(Thickness value1, float value2)

Parameters

value1 Thickness

The thickness.

value2 float

The float value to divide by.

Returns

Thickness

The divided thickness

operator ==(Thickness, Thickness)

public static bool operator ==(Thickness left, Thickness right)

Parameters

left Thickness
right Thickness

Returns

bool

operator !=(Thickness, Thickness)

public static bool operator !=(Thickness left, Thickness right)

Parameters

left Thickness
right Thickness

Returns

bool

operator *(Thickness, float)

Multiplies a Thickness by a float.

public static Thickness operator *(Thickness value1, float value2)

Parameters

value1 Thickness

The thickness.

value2 float

The float value to multiply with.

Returns

Thickness

The multiplied thickness

operator -(Thickness, Thickness)

Substracts one Thickness with another.

public static Thickness operator -(Thickness value1, Thickness value2)

Parameters

value1 Thickness

The thickness to subtract from.

value2 Thickness

The thickness to substract.

Returns

Thickness

A Thickness representing the difference between the two Thickness.

operator -(Thickness)

Reverses the direction of a given Thickness.

public static Thickness operator -(Thickness value)

Parameters

value Thickness

The Thickness to negate.

Returns

Thickness

A Thickness with the opposite direction.