Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawing using Debug2D overlays the editor when using tool script #163

Closed
Xrayez opened this issue Dec 5, 2021 · 1 comment
Closed

Drawing using Debug2D overlays the editor when using tool script #163

Xrayez opened this issue Dec 5, 2021 · 1 comment
Labels
bug Something isn't working component:scene enhancement Improvement of existing features topic:editor
Milestone

Comments

@Xrayez
Copy link
Contributor

Xrayez commented Dec 5, 2021

Goost and Godot version:
ca9d585, Godot 3.4

OS/platform/device including version:
Windows 10

Issue description:
Drawing using Debug2D via tool script results in this:

image

Steps to reproduce:

tool
extends Node2D

func _process(delta):
    Debug2D.clear()
    Debug2D.draw_circle(64)

Not sure if possible to resolve for now, but I think it should be possible to instantiate Debug2D in the canvas item 2D viewport rather than editor (or rather, point Debug2D.canvas_item property to root node in the scene or so), otherwise this should be documented, and behavior prevented by not instantiating Debug2D singleton in the editor itself.

@Xrayez Xrayez added bug Something isn't working enhancement Improvement of existing features topic:editor component:scene labels Dec 5, 2021
@Xrayez Xrayez added this to the 1.2-gd3 milestone Dec 5, 2021
@Xrayez Xrayez closed this as completed in a471b0c Dec 6, 2021
@Xrayez
Copy link
Contributor Author

Xrayez commented Dec 6, 2021

I made it work to draw stuff in the editor

image

This has a little quirk though: the drawing will persist across scenes if not cleared via script prior to that. Which is kind of expected since Debug2D operates globally. This might be a usability issue for some. In this case, perhaps adding some buttons to manually clear the debug draw canvas might be sufficient (or make an editor plugin to do this automatically). But again, drawing in the editor is not the primary use case for this feature, so I treat this as low priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:scene enhancement Improvement of existing features topic:editor
Projects
None yet
Development

No branches or pull requests

1 participant