Struct Size2
- Namespace
- Stride.Core.Mathematics
- Assembly
- Stride.Core.Mathematics.dll
Defines a 2D rectangular size (width,height).
[DataContract("!Size2")]
[DataStyle(DataStyle.Compact)]
public struct Size2 : IEquatable<Size2>
- Implements
Constructors
Size2(int, int)
Initializes a new instance of the Size2 struct.
public Size2(int width, int height)
Parameters
Fields
Empty
A zero size with (width, height) = (0,0)
public static readonly Size2 Empty
Field Value
Height
Height.
[DataMember(1)]
public int Height
Field Value
Width
Width.
[DataMember(0)]
public int Width
Field Value
Zero
A zero size with (width, height) = (0,0)
public static readonly Size2 Zero
Field Value
Methods
Deconstruct(out int, out int)
Deconstructs the vector's components into named variables.
public void Deconstruct(out int width, out int height)
Parameters
Equals(Size2)
Determines whether the specified object is equal to this instance.
public bool Equals(Size2 other)
Parameters
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe 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.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(Size2, Size2)
Implements the operator ==.
public static bool operator ==(Size2 left, Size2 right)
Parameters
Returns
- bool
The result of the operator.
operator !=(Size2, Size2)
Implements the operator !=.
public static bool operator !=(Size2 left, Size2 right)
Parameters
Returns
- bool
The result of the operator.