public sealed struct Vector2Int
Related Guides
Broader workflow and conceptual references connected to this API.
Constructors
Showing 4 constructors
No results match this filter.
Methods
Showing 16 methods
public Vector2Int Abs()
Returns a new integer vector with all values positive. -5 becomes 5, ect.
public Vector2Int ComponentMax(Vector2Int other)
Returns an integer vector that has the maximum values on each axis of the two input vectors.
public Vector2Int ComponentMin(Vector2Int other)
Returns an integer vector that has the minimum values on each axis of the two input vectors.
public bool IsNearlyZero(int tolerance = 0)
Returns true if value on every axis is less than or equal to tolerance
Parameters
tolerance: Default: 0
public static Vector2Int Max(Vector2Int a, Vector2Int b)
Returns an integer vector that has the maximum values on each axis between 2 given vectors.
public static Vector2Int Min(Vector2Int a, Vector2Int b)
Returns an integer vector that has the minimum values on each axis between 2 given vectors.
public Vector2Int Read(System.IO.BinaryReader reader)
public Vector2Int SnapToGrid(int gridSize, bool sx = True, bool sy = True)
Snap to grid along any of the 2 axes.
Parameters
sx: Default: Truesy: Default: True
public static override bool TryParse(string str, System.IFormatProvider info, Vector2Int result)
public Vector2Int WithX(int x)
Returns this integer vector with given X component.
public Vector2Int WithY(int y)
Returns this integer vector with given Y component.
public void Write(System.IO.BinaryWriter writer)
No results match this filter.
Properties
Showing 7 properties
public float Vector2Int.Degrees { get; set; }
Return the angle of this vector in degrees, always between 0 and 360.
public bool Vector2Int.IsZeroLength { get; set; }
Whether the length of this vector is zero or not.
public int Vector2Int.Item { get; set; }
public float Vector2Int.Length { get; set; }
Length (or magnitude) of the integer vector (Distance from 0,0)
public int Vector2Int.LengthSquared { get; set; }
Squared length of the integer vector. This is faster than Length, and can be used for things like comparing distances, as long as only squared values are used."/>
public Vector2 Vector2Int.Normal { get; set; }
Returns a unit version of this vector. Keep in mind this returns a Vector2 and not a Vector2Int.
public Vector2Int Vector2Int.Perpendicular { get; set; }
Returns an integer vector that runs perpendicular to this one.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | global |
| Type | class |
| Assembly | Sandbox.System |
| Doc ID | T:Vector2Int |