Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripting/api-reference/mat2d/mat2d.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ print(math.floor(r.x + 0.5), math.floor(r.y + 0.5)) -- 0, 1

Writes the inverse of 'input' into 'output'. Returns true if the input
matrix is invertible.
```lua
```lua highlight={4}
local m = Mat2D.withTranslation(50, 100)

local inv = Mat2D.identity()
Expand Down
28 changes: 28 additions & 0 deletions scripting/api-reference/vec2d/vector.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,21 @@ local len2 = Vector.lengthSquared(Vector.xy(3, 4)) -- 25

### `length`

<Warning>
**Deprecated** - Use `Vector.length` instead.
</Warning>

Returns the length of the vector.

use Vector.length(v) instead.


### `lengthSquared`

<Warning>
**Deprecated** - Use `Vector.lengthSquared` instead.
</Warning>

Returns the squared length of the vector.

Use `Vector.lengthSquared(v)` instead for better performance.
Expand All @@ -148,6 +156,10 @@ local len2 = v:lengthSquared() -- 25

### `normalized`

<Warning>
**Deprecated** - Use `Vector.normalized` instead.
</Warning>

Returns a normalized copy of the vector. If the length is zero,
the result is the zero vector.

Expand Down Expand Up @@ -219,6 +231,10 @@ local half = v / 2 -- 3 -2

### `distance`

<Warning>
**Deprecated** - Use `Vector.distance` instead.
</Warning>

Returns the distance to the other vector.

Use `Vector.distance(a, b)` instead for better performance.
Expand All @@ -231,6 +247,10 @@ print(a:distance(b)) -- 5

### `distanceSquared`

<Warning>
**Deprecated** - Use `Vector.distanceSquared` instead.
</Warning>

Returns the squared distance to the other vector.

Use `Vector.distanceSquared(a, b)` instead for better performance.
Expand All @@ -243,6 +263,10 @@ print(a:distanceSquared(b)) -- 25

### `dot`

<Warning>
**Deprecated** - Use `Vector.dot` instead.
</Warning>

Returns the dot product of the vector and the other vector.

Use `Vector.dot(a, b)` instead for better performance.
Expand All @@ -255,6 +279,10 @@ print(a:dot(b)) -- 11 (1*3 + 2*4)

### `lerp`

<Warning>
**Deprecated** - Use `Vector.lerp` instead.
</Warning>

Returns the linear interpolation between the vector and the other
vector, using t where 0 returns the vector and 1 returns the other.

Expand Down