static Vector2 Parse( string str )
static Vector2 Parse( string str, System.IFormatProvider provider )

book_4_sparkGenerated
code_blocksInput

Description

The Vector2.Parse method is a static method that converts a string representation of a 2D vector into a Vector2 object. The string should be formatted in a way that can be interpreted as a vector, typically in the form of "x,y" where x and y are floating-point numbers.

Usage

Use this method when you need to convert a string representation of a vector into a Vector2 object. This is useful for parsing user input or data from text files where vectors are stored as strings.

Example

// Example of using Vector2.Parse
string vectorString = "3.5,4.2";
Vector2 vector = Vector2.Parse(vectorString);

// vector now holds the value (3.5, 4.2)