Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    Size2 Struct

    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>
    Name Description
    Constructors
    Size2(Int32, Int32)

    Initializes a new instance of the Size2 struct.

    Fields
    Empty

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

    Height

    Height.

    Width

    Width.

    Zero

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

    Methods
    Equals(Size2)

    Determines whether the specified System.Object is equal to this instance.

    Equals(Object)
    GetHashCode()
    ToString()
    Operators
    Equality(Size2, Size2)

    Implements the operator ==.

    Inequality(Size2, Size2)

    Implements the operator !=.

    | Improve this Doc View Source

    Constructors


    Size2(Int32, Int32)

    Initializes a new instance of the Size2 struct.

    public Size2(int width, int height)
    Parameters
    Type Name Description
    System.Int32 width

    The x.

    System.Int32 height

    The y.

    | Improve this Doc View Source

    Fields


    Empty

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

    public static readonly Size2 Empty
    Field Value
    Type Description
    Size2

    Height

    Height.

    [DataMember(1)]
    public int Height
    Field Value
    Type Description
    System.Int32

    Width

    Width.

    [DataMember(0)]
    public int Width
    Field Value
    Type Description
    System.Int32

    Zero

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

    public static readonly Size2 Zero
    Field Value
    Type Description
    Size2
    | Improve this Doc View Source

    Methods


    Equals(Size2)

    Determines whether the specified System.Object is equal to this instance.

    public bool Equals(Size2 other)
    Parameters
    Type Name Description
    Size2 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(Size2, Size2)

    Implements the operator ==.

    public static bool operator ==(Size2 left, Size2 right)
    Parameters
    Type Name Description
    Size2 left

    The left.

    Size2 right

    The right.

    Returns
    Type Description
    System.Boolean

    The result of the operator.


    Inequality(Size2, Size2)

    Implements the operator !=.

    public static bool operator !=(Size2 left, Size2 right)
    Parameters
    Type Name Description
    Size2 left

    The left.

    Size2 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