# Vector2Int

- Kind: struct
- Assembly: `Sandbox.System`
- Modifiers: sealed

## Constructors

- [`Vector2Int`](/api/Vector2Int/.ctor): Initializes an integer vector with given components.

## Fields

- [`Down`](/api/Vector2Int/Down): An integer vector with Y set to -1. This represents the down direction.
- [`Left`](/api/Vector2Int/Left): An integer vector with X set to -1. This represents the left direction.
- [`One`](/api/Vector2Int/One): An integer vector with all components set to 1.
- [`Right`](/api/Vector2Int/Right): An integer vector with X set to 1. This represents the right direction.
- [`Up`](/api/Vector2Int/Up): An integer vector with Y set to 1. This represents the up direction.
- [`x`](/api/Vector2Int/x): The X component of this integer vector.
- [`y`](/api/Vector2Int/y): The Y component of this integer vector.
- [`Zero`](/api/Vector2Int/Zero): An integer vector with all components set to 0.

## Properties

- [`Degrees`](/api/Vector2Int/Degrees): Return the angle of this vector in degrees, always between 0 and 360.
- [`IsZeroLength`](/api/Vector2Int/IsZeroLength): Whether the length of this vector is zero or not.
- [`Item`](/api/Vector2Int/Item)
- [`Length`](/api/Vector2Int/Length): Length (or magnitude) of the integer vector (Distance from 0,0)
- [`LengthSquared`](/api/Vector2Int/LengthSquared): Squared length of the integer vector. This is faster than [Length](/api/Vector2Int/Length), and can be used for things like comparing distances, as long as only squared values are used."/>
- [`Normal`](/api/Vector2Int/Normal): Returns a unit version of this vector. Keep in mind this returns a Vector2 and not a Vector2Int.
- [`Perpendicular`](/api/Vector2Int/Perpendicular): Returns an integer vector that runs perpendicular to this one.

## Methods

- [`Abs`](/api/Vector2Int/Abs): Returns a new integer vector with all values positive. -5 becomes 5, ect.
- [`ComponentMax`](/api/Vector2Int/ComponentMax): Returns an integer vector that has the maximum values on each axis of the two input vectors.
- [`ComponentMin`](/api/Vector2Int/ComponentMin): Returns an integer vector that has the minimum values on each axis of the two input vectors.
- [`Distance`](/api/Vector2Int/Distance): Returns the distance between this vector and another.
- [`IsNearlyZero`](/api/Vector2Int/IsNearlyZero): Returns true if value on every axis is less than or equal to tolerance
- [`Max`](/api/Vector2Int/Max): Returns an integer vector that has the maximum values on each axis between 2 given vectors.
- [`Min`](/api/Vector2Int/Min): Returns an integer vector that has the minimum values on each axis between 2 given vectors.
- [`Parse`](/api/Vector2Int/Parse): Given a string, try to convert this into a Vector2Int. Example formatting is "x,y", "[x,y]", "x y", etc.
- [`Read`](/api/Vector2Int/Read)
- [`SnapToGrid`](/api/Vector2Int/SnapToGrid): Snap to grid along any of the 2 axes.
- [`TryParse`](/api/Vector2Int/TryParse)
- [`WithX`](/api/Vector2Int/WithX): Returns this integer vector with given X component.
- [`WithY`](/api/Vector2Int/WithY): Returns this integer vector with given Y component.
- [`Write`](/api/Vector2Int/Write)
