Point Struct
Namespace: Stride.Core.MathematicsAssembly: Stride.Core.Mathematics.dll
A 2D point.
[DataContract]
public struct Point : IEquatable<Point>
Name | Description | |
---|---|---|
Constructors | ||
Point(Int32, Int32) | Initializes a new instance of the Point struct. |
|
Fields | ||
X | Left coordinate. |
|
Y | Top coordinate. |
|
Zero | A point with (0,0) coordinates. |
|
Methods | ||
Equals(Point) | Determines whether the specified System.Object is equal to this instance. |
|
Equals(Object) | ||
GetHashCode() | ||
ToString() | ||
Operators | ||
Equality(Point, Point) | Implements the operator ==. |
|
Explicit(Vector2 to Point) | ||
Implicit(Point to Vector2) | ||
Inequality(Point, Point) | Implements the operator !=. |
Constructors
Point(Int32, Int32)
Initializes a new instance of the Point struct.
public Point(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x. |
System.Int32 | y | The y. |
Fields
X
Left coordinate.
[DataMember(0)]
public int X
Field Value
Type | Description |
---|---|
System.Int32 |
Y
Top coordinate.
[DataMember(1)]
public int Y
Field Value
Type | Description |
---|---|
System.Int32 |
Zero
A point with (0,0) coordinates.
public static readonly Point Zero
Field Value
Type | Description |
---|---|
Point |
Methods
Equals(Point)
Determines whether the specified System.Object is equal to this instance.
public bool Equals(Point other)
Parameters
Type | Name | Description |
---|---|---|
Point | 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(Point, Point)
Implements the operator ==.
public static bool operator ==(Point left, Point right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | The left. |
Point | right | The right. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
Explicit(Vector2 to Point)
public static explicit operator Point(Vector2 value)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | value | The value. |
Returns
Type | Description |
---|---|
Point | The result of the conversion. |
Implicit(Point to Vector2)
public static implicit operator Vector2(Point value)
Parameters
Type | Name | Description |
---|---|---|
Point | value | The value. |
Returns
Type | Description |
---|---|
Vector2 | The result of the conversion. |
Inequality(Point, Point)
Implements the operator !=.
public static bool operator !=(Point left, Point right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | The left. |
Point | right | The right. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |