Table of Contents

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

width int

The x.

height int

The y.

Fields

Empty

A zero size with (width, height) = (0,0)

public static readonly Size2 Empty

Field Value

Size2

Height

Height.

[DataMember(1)]
public int Height

Field Value

int

Width

Width.

[DataMember(0)]
public int Width

Field Value

int

Zero

A zero size with (width, height) = (0,0)

public static readonly Size2 Zero

Field Value

Size2

Methods

Deconstruct(out int, out int)

Deconstructs the vector's components into named variables.

public void Deconstruct(out int width, out int height)

Parameters

width int

The Width component

height int

The Height component

Equals(Size2)

Determines whether the specified object is equal to this instance.

public bool Equals(Size2 other)

Parameters

other Size2

The object to compare with this instance.

Returns

bool

true if the specified object is equal to this instance; 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.

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

left Size2

The left.

right Size2

The right.

Returns

bool

The result of the operator.

operator !=(Size2, Size2)

Implements the operator !=.

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

Parameters

left Size2

The left.

right Size2

The right.

Returns

bool

The result of the operator.