Size2 Struct
Namespace: Stride.Core.MathematicsAssembly: Stride.Core.Mathematics.dll
Defines a 2D rectangular size (width,height).
[DataContract("!Size2")]
[DataStyle(DataStyle.Compact)]
public struct Size2 : IEquatable<Size2>
| Name | Description | |
|---|---|---|
| Constructors | ||
| Size2(Int32, Int32) | Initializes a new instance of the Size2 struct. |
|
| Fields | ||
| Empty | A zero size with (width, height) = (0,0) |
|
| Height | Height. |
|
| Width | Width. |
|
| Zero | A zero size with (width, height) = (0,0) |
|
| Methods | ||
| Equals(Size2) | Determines whether the specified System.Object is equal to this instance. |
|
| Equals(Object) | ||
| GetHashCode() | ||
| ToString() | ||
| Operators | ||
| Equality(Size2, Size2) | Implements the operator ==. |
|
| Inequality(Size2, Size2) | Implements the operator !=. |
|
Constructors
Size2(Int32, Int32)
Initializes a new instance of the Size2 struct.
public Size2(int width, int height)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | width | The x. |
| System.Int32 | height | The y. |
Fields
Empty
A zero size with (width, height) = (0,0)
public static readonly Size2 Empty
Field Value
| Type | Description |
|---|---|
| Size2 |
Height
Height.
[DataMember(1)]
public int Height
Field Value
| Type | Description |
|---|---|
| System.Int32 |
Width
Width.
[DataMember(0)]
public int Width
Field Value
| Type | Description |
|---|---|
| System.Int32 |
Zero
A zero size with (width, height) = (0,0)
public static readonly Size2 Zero
Field Value
| Type | Description |
|---|---|
| Size2 |
Methods
Equals(Size2)
Determines whether the specified System.Object is equal to this instance.
public bool Equals(Size2 other)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2 | other | The System.Object to compare with this instance. |
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
ToString()
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |
Overrides
Operators
Equality(Size2, Size2)
Implements the operator ==.
public static bool operator ==(Size2 left, Size2 right)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2 | left | The left. |
| Size2 | right | The right. |
Returns
| Type | Description |
|---|---|
| System.Boolean | The result of the operator. |
Inequality(Size2, Size2)
Implements the operator !=.
public static bool operator !=(Size2 left, Size2 right)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2 | left | The left. |
| Size2 | right | The right. |
Returns
| Type | Description |
|---|---|
| System.Boolean | The result of the operator. |