EditorPlugin._forward_canvas_draw_over_viewport()
let you draw in the 2D viewport and has a small example on how to use it. You’ll need to also implement EditorPlugin._handles()
and EditorPlugin._forward_canvas_gui_input()
Small example:
@tool
extends EditorPlugin
func _handles(object: Object) -> bool:
# Handles only Node2D nodes and nodes that inherit it (so no Controls for example)
return object is Node2D
func _forward_canvas_draw_over_viewport(viewport_control: Control) -> void:
viewport_control.draw_circle(viewport_control.get_local_mouse_position(), 64, Color.RED)
func _forward_canvas_gui_input(event: InputEvent) -> bool:
if event is InputEventMouseMotion:
update_overlays()
return true
return false
For the other stuff it’s too broad to give any help.