- Edited
hello,
i have an editor plugin. It instances a scene and puts in a left dock,
i made a new sprite node in the scene that draws a square that follows the mouse coords,
problem is... now its being drawn on 2 places, instead of the main screen...
( plugin script )
@tool
extends EditorPlugin
const editorAddon = preload("res://plugIN/addon.tscn");
func _enter_tree():
dockedScene = editorAddon.instantiate();
add_control_to_container(CONTAINER_CANVAS_EDITOR_SIDE_RIGHT, dockedScene );
( canvas script )
@tool
extends Sprite2D
func _enter_tree():
scene_root = get_tree().get_edited_scene_root()
mGpos = scene_root.get_local_mouse_position()
func _draw():
draw_rect(Rect2(mGpos.x, mGpos.y, 32, 32 ), Color.YELLOW, true );
draw_string(font,Vector2(5, 570),"mPOS: "+ str( mGpos ), HORIZONTAL_ALIGNMENT_LEFT, -1, 12, Color.WHITE );
It gets wrost when i create a new scene, the drawing only shows on the dock
Is there a way to solve this problem, or place were i can see how plugIns work, i cant find any info about it, and some commands used in plug ins dont even show on the manual...
Ive tried multiple things nothing seems to work... // instancianting 2 scenes 1 for drawing other for the dock, doesnt work
func _forward_canvas_draw_over_viewport(viewport_control) doesnt do anyhing....