Nostalgia
2.1.5
|
Classes for handling two-dimensional integer coordinates. More...
Public Member Functions | |
Point2 (int x, int y) | |
Initializes a new instance of the Nostalgia.Point2 class. More... | |
Point2 (Point2 p) | |
Initializes a new instance of the Nostalgia.Point2 class. More... | |
bool | IsInsideRect (int x, int y, int width, int height) |
It is inside a rectangle More... | |
Static Public Member Functions | |
static Point2 | operator+ (Point2 a, Point2 b) |
Addition of Point2 each other. More... | |
static Point2 | operator- (Point2 a, Point2 b) |
Subtraction of Point2 each other. More... | |
static Point2 | operator- (Point2 a) |
Inversion of the sign. More... | |
static Point2 | operator* (Point2 a, int b) |
Multiplication of Point2. More... | |
static Point2 | operator* (int a, Point2 b) |
Multiplication of Point2. More... | |
static Point2 | operator/ (Point2 a, int b) |
Division of Point2. More... | |
static bool | operator== (Point2 a, Point2 b) |
Returns true if the Point2s are equal. More... | |
static bool | operator!= (Point2 a, Point2 b) |
Returns true if Point2s different. More... | |
static implicit | operator Point2 (Vector2 v) |
Performs an implicit conversion from Vector2 to Point2. More... | |
static implicit | operator Vector2 (Point2 p) |
Performs an implicit conversion from Point2 to Vector2. More... | |
Public Attributes | |
int | x |
The x coordinate. More... | |
int | y |
The y coordinate. More... | |
Static Public Attributes | |
static readonly Point2 | zero = new Point2(0, 0) |
Get Point2 of (0,0). More... | |
Properties | |
float | sqrMagnitude [get] |
Returns the squared length of this Point2. More... | |
float | magnitude [get] |
Returns the length of this Point2. More... | |
Classes for handling two-dimensional integer coordinates.
Point2 | ( | int | x, |
int | y | ||
) |
Initializes a new instance of the Nostalgia.Point2 class.
x | The x coordinate. |
y | The y coordinate. |
Initializes a new instance of the Nostalgia.Point2 class.
p | Point2 |
bool IsInsideRect | ( | int | x, |
int | y, | ||
int | width, | ||
int | height | ||
) |
It is inside a rectangle
x | x |
y | y |
width | width |
height | height |
|
static |
Performs an implicit conversion from Vector2 to Point2.
v | Vector2. |
|
static |
int x |
The x coordinate.
int y |
The y coordinate.
|
get |
Returns the length of this Point2.
The magnitude.
|
get |
Returns the squared length of this Point2.
the squared length.