-
Notifications
You must be signed in to change notification settings - Fork 1
Scratch
Hyomoto edited this page Oct 12, 2020
·
10 revisions
Jump To | Go Back |
Arguments | Methods | Variables |
---|
A simple, garbage-collected two-dimensional vector.
var _vec2 = new Vec2( 32, 20 );
Name | Type | Purpose |
---|---|---|
x |
real | The x position in this vector |
y |
real | The y position in this vector |
Jump To | top |
set | add | subtract | multiply | divide | dot | toArray | toString | is |
---|
Returns: N/A (undefined
)
Name | Type | Purpose |
---|---|---|
x |
real | The x position to set this vector |
y |
real | The y position to set this vector |
Used to set both the x and y coordinates in this vector with a single method.
Returns: Vec2
Name | Type | Purpose |
---|---|---|
Vec2 |
Vec2 | The vector to add to this one. |
Used to sum two Vec2's together.
Returns: Vec2
Name | Type | Purpose |
---|---|---|
Vec2 |
Vec2 | The vector to subtract from this one. |
Used to find the difference between two Vec2's.
Returns: Vec2
Name | Type | Purpose |
---|---|---|
Vec2 |
Vec2 | The vector to multiply this one with. |
Used to multiply two Vec2's together.
Returns: Vec2
Name | Type | Purpose |
---|---|---|
Vec2 |
Vec2 | The vector to divide this one by. |
Used to divide two Vec2's.
Returns: real (0.00
)
Name | Type | Purpose |
---|---|---|
Vec2 |
Vec2 | The vector to get the dot product with. |
Used to retrieve the dot product two Vec2's together.
Returns: array([ x, y ]
)
Name | Type | Purpose |
---|---|---|
None |
Returns this vector as an array.
Returns: string("x, y")
Name | Type | Purpose |
---|---|---|
None |
Returns this vector as a comma-separated string value pair.
Returns: string("x, y")
Name | Type | Purpose |
---|---|---|
type |
struct id | The structure type to compare this against. |
Returns true
if the provided type is Timer.
Jump To | top |
---|
- x - the x position of this vector
- y - the y position of this vector
Devon Mullane 2020