Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    Point Struct

    Namespace: Stride.Core.Mathematics
    Assembly: 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)

    Performs an implicit conversion from Vector2 to Point.

    Implicit(Point to Vector2)

    Performs an explicit conversion from Point to Vector2.

    Inequality(Point, Point)

    Implements the operator !=.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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

    true if the specified System.Object is equal to this instance; otherwise, false.


    Equals(Object)

    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)

    GetHashCode()

    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    ToString()

    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.ValueType.ToString()
    | Improve this Doc View Source

    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)

    Performs an implicit conversion from 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)

    Performs an explicit conversion from 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.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation