Add get_object_center method to misc.gd
This commit is contained in:
parent
b574ca6900
commit
f9f42095cf
1 changed files with 4 additions and 0 deletions
4
misc.gd
4
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
|
||||
|
|
Loading…
Reference in a new issue