16 lines
541 B
GDScript
16 lines
541 B
GDScript
@tool
|
|
extends Control
|
|
|
|
@export var radius: float = 10.
|
|
@export_range(0,360,0.01,"or_greater","radians_as_degrees") var arch: float = PI/6
|
|
|
|
|
|
func _process(_delta: float) -> void:
|
|
for i in range(get_child_count()):
|
|
var child: Card = get_child(i)
|
|
if child.top_level:
|
|
continue
|
|
|
|
var angle: float = -arch+2*arch*((float(i+0.5))/get_child_count())
|
|
var pointing_up: float = angle - PI/2
|
|
child.position = lerp(child.position,get_combined_pivot_offset()+Vector2.from_angle(pointing_up) * radius-child.get_combined_pivot_offset(),0.25)
|