Vector2Intclass
Constructors4
Showing 4 constructors
No results match this filter.
Methods16
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.
| Parameter | Type | Description |
|---|---|---|
| other | Vector2Int | — |
public Vector2Int ComponentMin(Vector2Int other)
Returns an integer vector that has the minimum values on each axis of the two input vectors.
| Parameter | Type | Description |
|---|---|---|
| other | Vector2Int | — |
public bool IsNearlyZero(int tolerance = 0)
Returns true if value on every axis is less than or equal to tolerance
| Parameter | Type | Description |
|---|---|---|
| tolerance = 0 | int | — |
bool—public static Vector2Int Max(Vector2Int a, Vector2Int b)
Returns an integer vector that has the maximum values on each axis between 2 given vectors.
| Parameter | Type | Description |
|---|---|---|
| a | Vector2Int | — |
| b | Vector2Int | — |
public static Vector2Int Min(Vector2Int a, Vector2Int b)
Returns an integer vector that has the minimum values on each axis between 2 given vectors.
| Parameter | Type | Description |
|---|---|---|
| a | Vector2Int | — |
| b | Vector2Int | — |
public Vector2Int Read(System.IO.BinaryReader reader)
| Parameter | Type | Description |
|---|---|---|
| reader | BinaryReader | — |
public Vector2Int SnapToGrid(int gridSize, bool sx = True, bool sy = True)
Snap to grid along any of the 2 axes.
| Parameter | Type | Description |
|---|---|---|
| gridSize | int | — |
| sx = True | bool | — |
| sy = True | bool | — |
public static override bool TryParse(string str, System.IFormatProvider info, Vector2Int result)
| Parameter | Type | Description |
|---|---|---|
| str | string | — |
| info | IFormatProvider | — |
| result | Vector2Int | — |
bool—public Vector2Int WithX(int x)
Returns this integer vector with given X component.
| Parameter | Type | Description |
|---|---|---|
| x | int | — |
public Vector2Int WithY(int y)
Returns this integer vector with given Y component.
| Parameter | Type | Description |
|---|---|---|
| y | int | — |
public void Write(System.IO.BinaryWriter writer)
| Parameter | Type | Description |
|---|---|---|
| writer | BinaryWriter | — |
void—No results match this filter.
Properties7
Showing 7 properties
public float Vector2Int.Degrees { get; set; }
Return the angle of this vector in degrees, always between 0 and 360.
float—public bool Vector2Int.IsZeroLength { get; set; }
Whether the length of this vector is zero or not.
bool—public int Vector2Int.Item { get; set; }
int—public float Vector2Int.Length { get; set; }
Length (or magnitude) of the integer vector (Distance from 0,0)
float—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."/>
int—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.