Is it possible to show custom draw calls on the scene editor?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By wombatTurkey
:warning: Old Version Published before Godot 3 was released.

I attached a script to a node. It’s using _draw() (draw_rect) to create some rectangles. I’m curious if it’s possible to get these rectangles to show up on the 2d Scene Editor as well?

:bust_in_silhouette: Reply From: volzhs

There is Performance.get_monitor(RENDER_DRAW_CALLS_IN_FRAME)
But this returns only 0 for 2d scene.

Is there anything similar for the 2D engine?

Zylann | 2016-08-02 12:40

Not that I know of.

volzhs | 2016-08-05 14:19

:bust_in_silhouette: Reply From: Scipi

Using the tool keyword at the top of your script lets it run in the editor. It should run those custom draw calls as well. Just be sure your script doesn’t execute any game code.