From f9f42095cf2e1a06db5a425f24f8bb78c91b863b Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 25 Aug 2023 16:57:17 +0200 Subject: [PATCH] Add get_object_center method to misc.gd --- misc.gd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc.gd b/misc.gd index fd7ca32..b10f176 100644 --- a/misc.gd +++ b/misc.gd @@ -66,3 +66,7 @@ func flat_float(number:float) -> float: func flat_float_int(number:float) -> int: return int(number) + +# Get object center +func get_object_center(child_size:float,parent_size:float) -> float: + return parent_size/2-child_size/2