s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
school
Tutorials
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
Vector2Int
chevron_left
Classes
struct
Vector2Int
search
Constructors
functions
Vector2Int
Fields
crop_din
x
crop_din
y
Properties
data_object
Degrees
data_object
IsZeroLength
data_object
Item
data_object
Length
data_object
LengthSquared
data_object
Normal
data_object
Perpendicular
Methods
functions
Abs
functions
ComponentMax
functions
ComponentMin
functions
Distance
functions
IsNearlyZero
functions
Read
functions
SnapToGrid
functions
WithX
functions
WithY
functions
Write
Static Fields
crop_din
Down
crop_din
Left
crop_din
One
crop_din
Right
crop_din
Up
crop_din
Zero
Static Methods
functions
Max
functions
Min
functions
Parse
functions
TryParse
Vector2Int
struct
sealed
Sandbox.System
build
Constructors
1
Vector2Int
(
x
,
y
)
Initializes an integer vector with given components.
crop_din
Fields
2
x
int
The X component of this integer vector.
y
int
The Y component of this integer vector.
data_object
Properties
7
Degrees
float
Return the angle of this vector in degrees, always between 0 and 360.
IsZeroLength
bool
Whether the length of this vector is zero or not.
Item
int
Length
float
Length (or magnitude) of the integer vector (Distance from 0,0)
LengthSquared
int
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."/>
Normal
Vector2
Returns a unit version of this vector. Keep in mind this returns a Vector2 and not a Vector2Int.
Perpendicular
Vector2Int
Returns an integer vector that runs perpendicular to this one.
functions
Methods
10
Abs
(
)
Vector2Int
Returns a new integer vector with all values positive. -5 becomes 5, ect.
ComponentMax
(
other
)
Vector2Int
Returns an integer vector that has the maximum values on each axis of the two input vectors.
ComponentMin
(
other
)
Vector2Int
Returns an integer vector that has the minimum values on each axis of the two input vectors.
Distance
(
other
)
float
Returns the distance between this vector and another.
IsNearlyZero
(
tolerance
)
bool
Returns true if value on every axis is less than or equal to tolerance
Read
(
reader
)
Vector2Int
SnapToGrid
(
gridSize
,
sx
,
sy
)
Vector2Int
Snap to grid along any of the 2 axes.
WithX
(
x
)
Vector2Int
Returns this integer vector with given X component.
WithY
(
y
)
Vector2Int
Returns this integer vector with given Y component.
Write
(
writer
)
crop_din
Static Fields
6
Down
Vector2Int
An integer vector with Y set to -1. This represents the down direction.
Left
Vector2Int
An integer vector with X set to -1. This represents the left direction.
One
Vector2Int
An integer vector with all components set to 1.
Right
Vector2Int
An integer vector with X set to 1. This represents the right direction.
Up
Vector2Int
An integer vector with Y set to 1. This represents the up direction.
Zero
Vector2Int
An integer vector with all components set to 0.
functions
Static Methods
4
Max
(
a
,
b
)
Vector2Int
Returns an integer vector that has the maximum values on each axis between 2 given vectors.
Min
(
a
,
b
)
Vector2Int
Returns an integer vector that has the minimum values on each axis between 2 given vectors.
Parse
(
str
)
Vector2Int
Given a string, try to convert this into a Vector2Int. Example formatting is "x,y", "[x,y]", "x y", etc.
TryParse
(
str
,
info
,
result
)
bool
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.