Size


Declaration

[Serializable]
public struct Size : IEquatable<Size>, IComparable<Size>

Description

Stores the size of an entity as a width and height.

Static Properties

zeroShorthand for writing Size(0, 0).
oneShorthand for writing Size(1, 1).
maxShorthand for writing Size(int.MaxValue, int.MaxValue).
sq2Shorthand for writing Size(2).
sq4Shorthand for writing Size(4).
sq8Shorthand for writing Size(8).
sq16Shorthand for writing Size(16).
sq32Shorthand for writing Size(32).
sq64Shorthand for writing Size(64).
sq128Shorthand for writing Size(128).
sq256Shorthand for writing Size(256).
sq512Shorthand for writing Size(512).
sq1024Shorthand for writing Size(1024).
sq2048Shorthand for writing Size(2048).
sq4096Shorthand for writing Size(4096).
sq8192Shorthand for writing Size(8192).

Properties

widthThe width of the entity.
heightThe height of the entity.
AreaThe area of the entity (width * height) (Read only).

Constructors

SizeCreates a new size with the specified width and height.

Methods

CompareToCompares this instance with another and returns an integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the other instance.
EqualsDetermines if the size is equal to another size.
GetHashCodeReturns the hash code of the size.
ToStringConverts the size to a string.

Operators

EqualityDetermines if two sizes are equal.
InequalityDetermines if two sizes are not equal.