Show / Hide Table of Contents

Struct Rect

Implements
IEquatable<Rect>
Inherited Members
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Namespace: UnityEngine
Assembly: UnityEngine.dll
Syntax
public struct Rect : IEquatable<Rect>

Constructors

| Improve this Doc View Source

Rect(Single, Single, Single, Single)

Declaration
public Rect(float x, float y, float width, float height)
Parameters
Type Name Description
Single x
Single y
Single width
Single height
| Improve this Doc View Source

Rect(Rect)

Declaration
public Rect(Rect source)
Parameters
Type Name Description
Rect source
| Improve this Doc View Source

Rect(Vector2, Vector2)

Declaration
public Rect(Vector2 position, Vector2 size)
Parameters
Type Name Description
Vector2 position
Vector2 size

Properties

| Improve this Doc View Source

bottom

Declaration
[Obsolete("use yMax")]
public float bottom { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

center

Declaration
public Vector2 center { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

height

Declaration
public float height { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

left

Declaration
[Obsolete("use xMin")]
public float left { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

max

Declaration
public Vector2 max { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

min

Declaration
public Vector2 min { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

position

Declaration
public Vector2 position { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

right

Declaration
[Obsolete("use xMax")]
public float right { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

size

Declaration
public Vector2 size { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

top

Declaration
[Obsolete("use yMin")]
public float top { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

width

Declaration
public float width { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

x

Declaration
public float x { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

xMax

Declaration
public float xMax { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

xMin

Declaration
public float xMin { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

y

Declaration
public float y { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

yMax

Declaration
public float yMax { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

yMin

Declaration
public float yMin { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

zero

Declaration
public static Rect zero { get; }
Property Value
Type Description
Rect

Methods

| Improve this Doc View Source

Contains(Vector2)

Declaration
public bool Contains(Vector2 point)
Parameters
Type Name Description
Vector2 point
Returns
Type Description
Boolean
| Improve this Doc View Source

Contains(Vector3)

Declaration
public bool Contains(Vector3 point)
Parameters
Type Name Description
Vector3 point
Returns
Type Description
Boolean
| Improve this Doc View Source

Contains(Vector3, Boolean)

Declaration
public bool Contains(Vector3 point, bool allowInverse)
Parameters
Type Name Description
Vector3 point
Boolean allowInverse
Returns
Type Description
Boolean
| Improve this Doc View Source

Equals(Object)

Declaration
public override bool Equals(object other)
Parameters
Type Name Description
Object other
Returns
Type Description
Boolean
Overrides
ValueType.Equals(Object)
| Improve this Doc View Source

Equals(Rect)

Declaration
public bool Equals(Rect other)
Parameters
Type Name Description
Rect other
Returns
Type Description
Boolean
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32
Overrides
ValueType.GetHashCode()
| Improve this Doc View Source

MinMaxRect(Single, Single, Single, Single)

Declaration
public static Rect MinMaxRect(float xmin, float ymin, float xmax, float ymax)
Parameters
Type Name Description
Single xmin
Single ymin
Single xmax
Single ymax
Returns
Type Description
Rect
| Improve this Doc View Source

NormalizedToPoint(Rect, Vector2)

Declaration
public static Vector2 NormalizedToPoint(Rect rectangle, Vector2 normalizedRectCoordinates)
Parameters
Type Name Description
Rect rectangle
Vector2 normalizedRectCoordinates
Returns
Type Description
Vector2
| Improve this Doc View Source

Overlaps(Rect)

Declaration
public bool Overlaps(Rect other)
Parameters
Type Name Description
Rect other
Returns
Type Description
Boolean
| Improve this Doc View Source

Overlaps(Rect, Boolean)

Declaration
public bool Overlaps(Rect other, bool allowInverse)
Parameters
Type Name Description
Rect other
Boolean allowInverse
Returns
Type Description
Boolean
| Improve this Doc View Source

PointToNormalized(Rect, Vector2)

Declaration
public static Vector2 PointToNormalized(Rect rectangle, Vector2 point)
Parameters
Type Name Description
Rect rectangle
Vector2 point
Returns
Type Description
Vector2
| Improve this Doc View Source

Set(Single, Single, Single, Single)

Declaration
public void Set(float x, float y, float width, float height)
Parameters
Type Name Description
Single x
Single y
Single width
Single height
| Improve this Doc View Source

ToString()

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

ToString(String)

Declaration
public string ToString(string format)
Parameters
Type Name Description
String format
Returns
Type Description
String

Operators

| Improve this Doc View Source

Equality(Rect, Rect)

Declaration
public static bool operator ==(Rect lhs, Rect rhs)
Parameters
Type Name Description
Rect lhs
Rect rhs
Returns
Type Description
Boolean
| Improve this Doc View Source

Inequality(Rect, Rect)

Declaration
public static bool operator !=(Rect lhs, Rect rhs)
Parameters
Type Name Description
Rect lhs
Rect rhs
Returns
Type Description
Boolean

Implements

System.IEquatable<T>

Extension Methods

MustExtensions.MustBeEqual<T>(T, T)
MustExtensions.MustBeEqual<T>(T, T, String)
MustExtensions.MustNotBeEqual<T>(T, T)
MustExtensions.MustNotBeEqual<T>(T, T, String)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX