AxisMarker2D.gd 333 B

1234567891011121314
  1. @tool
  2. @icon("res://marker/AxisMarker2D.svg")
  3. class_name AxisMarker2D
  4. extends Node2D
  5. func _process(_delta: float) -> void:
  6. var line: Line2D = get_child(0).get_child(0)
  7. var marker_parent: Node = get_parent()
  8. line.points[1] = transform.origin
  9. if marker_parent as Node2D != null:
  10. line.transform = marker_parent.global_transform