AxisMarker2D.gd 312 B

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