diff --git a/scripting/api-reference/mat2d/mat2d.mdx b/scripting/api-reference/mat2d/mat2d.mdx index e19cd904..db116c25 100644 --- a/scripting/api-reference/mat2d/mat2d.mdx +++ b/scripting/api-reference/mat2d/mat2d.mdx @@ -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() diff --git a/scripting/api-reference/vec2d/vector.mdx b/scripting/api-reference/vec2d/vector.mdx index 4a8ba55a..23783362 100644 --- a/scripting/api-reference/vec2d/vector.mdx +++ b/scripting/api-reference/vec2d/vector.mdx @@ -130,6 +130,10 @@ local len2 = Vector.lengthSquared(Vector.xy(3, 4)) -- 25 ### `length` + + **Deprecated** - Use `Vector.length` instead. + + Returns the length of the vector. use Vector.length(v) instead. @@ -137,6 +141,10 @@ use Vector.length(v) instead. ### `lengthSquared` + + **Deprecated** - Use `Vector.lengthSquared` instead. + + Returns the squared length of the vector. Use `Vector.lengthSquared(v)` instead for better performance. @@ -148,6 +156,10 @@ local len2 = v:lengthSquared() -- 25 ### `normalized` + + **Deprecated** - Use `Vector.normalized` instead. + + Returns a normalized copy of the vector. If the length is zero, the result is the zero vector. @@ -219,6 +231,10 @@ local half = v / 2 -- 3 -2 ### `distance` + + **Deprecated** - Use `Vector.distance` instead. + + Returns the distance to the other vector. Use `Vector.distance(a, b)` instead for better performance. @@ -231,6 +247,10 @@ print(a:distance(b)) -- 5 ### `distanceSquared` + + **Deprecated** - Use `Vector.distanceSquared` instead. + + Returns the squared distance to the other vector. Use `Vector.distanceSquared(a, b)` instead for better performance. @@ -243,6 +263,10 @@ print(a:distanceSquared(b)) -- 25 ### `dot` + + **Deprecated** - Use `Vector.dot` instead. + + Returns the dot product of the vector and the other vector. Use `Vector.dot(a, b)` instead for better performance. @@ -255,6 +279,10 @@ print(a:dot(b)) -- 11 (1*3 + 2*4) ### `lerp` + + **Deprecated** - Use `Vector.lerp` instead. + + Returns the linear interpolation between the vector and the other vector, using t where 0 returns the vector and 1 returns the other.