From 54d81da32fff0d1c215a598a61fc33167bf152e0 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 25 Mar 2024 21:10:59 +0100 Subject: [PATCH] Update function name --- docs/docs/reference/misc.md | 2 +- src/Misc.gd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/reference/misc.md b/docs/docs/reference/misc.md index db5c4e7..0faa682 100644 --- a/docs/docs/reference/misc.md +++ b/docs/docs/reference/misc.md @@ -50,7 +50,7 @@ Converts an array into a string array. If an item is found that is not of type `String`, an empty array is returned. ### *Array* stringarray_to_array(*Array[String]* array) Converts a string array into an array. -### *Vector2* center_object(*Vector2* parent_size, *Vector2* child_size) +### *Vector2* get_center(*Vector2* parent_size, *Vector2* child_size) Calculates the center of the child in the area of the parent. Example: diff --git a/src/Misc.gd b/src/Misc.gd index 36b1a51..a7e9fbc 100644 --- a/src/Misc.gd +++ b/src/Misc.gd @@ -80,5 +80,5 @@ func stringarray_to_array(array: Array[String]) -> Array: return output -func center_object(parent_size: Vector2, child_size: Vector2) -> Vector2: +func get_center(parent_size: Vector2, child_size: Vector2) -> Vector2: return Vector2(parent_size.x/2-child_size.x/2, parent_size.y/2-child_size.y/2)