3#include "common/colors.h"
4#include "utils/compiler.h"
9#include <godot_cpp/classes/control.hpp>
10#include <godot_cpp/classes/font.hpp>
11GODOT_WARNING_RESTORE()
14class DataGraphManager;
37 const static char *s_marked_dirty;
39 bool _is_drawing_frame =
true;
40 bool _canvas_need_update =
true;
42 Ref<DebugDraw2DStats> stats_2d;
44 Callable call_canvas_item_draw_cache;
45 uint64_t default_control_id = 0;
47#ifndef DISABLE_DEBUG_RENDERING
48 std::unique_ptr<GroupedText> grouped_text;
49 std::unique_ptr<DataGraphManager> data_graphs;
52#ifndef DISABLE_DEBUG_RENDERING
53 void _finish_frame_and_update();
54 void _clear_all_internal();
55 void _set_custom_canvas_internal(Control *_canvas);
58 void _on_canvas_item_draw(Control *ci);
59 inline bool _is_enabled_override()
const;
61 void process_start(
double delta);
62 void process_end(
double delta);
63 void physics_process_start(
double delta);
64 void physics_process_end(
double delta);
66#pragma region Exposed Parameter Values
70 bool debug_enabled =
true;
71 uint64_t custom_control_id = 0;
73 Ref<DebugDraw2DConfig> config;
79 static void _bind_methods();
95 void mark_canvas_dirty();
97 bool is_drawing_frame()
const;
100 Node *get_root_node();
102#pragma region Exposed Parameters
104 void set_empty_color(
const Color &_col);
114 bool is_debug_enabled()
const;
131 Control *get_custom_canvas()
const;
134#pragma region Exposed Draw Functions
159 void begin_text_group(String group_title,
int group_priority = 0, Color group_color = Colors::white_smoke,
bool show_title =
true,
int title_size = 14,
int text_size = 12);
175 void set_text(String key, Variant value = Variant(),
int priority = 0, Color color_of_value = Colors::empty_color, real_t duration = -1);
221 Ref<DebugDraw2DGraph>
get_graph(
const StringName &title);
This is a class for storing part of the DebugDraw2D configuration.
Definition config_2d.h:20
Base class for drawing graphs.
Definition graphs.h:26
You can get basic statistics about 2D rendering from this class.
Definition stats_2d.h:18
Singleton class for calling debugging 2D methods.
Definition debug_draw_2d.h:27
Ref< DebugDraw2DConfig > get_config() const
void set_custom_canvas(Control *_canvas)
Ref< DebugDraw2DGraph > create_fps_graph(const StringName &title)
void set_debug_enabled(const bool &_state)
Ref< DebugDraw2DGraph > get_graph(const StringName &title)
Color get_empty_color() const
void remove_graph(const StringName &title)
void graph_update_data(const StringName &title, real_t data)
Ref< DebugDraw2DStats > get_render_stats()
Ref< DebugDraw2DGraph > create_graph(const StringName &title)
void set_text(String key, Variant value=Variant(), int priority=0, Color color_of_value=Colors::empty_color, real_t duration=-1)
static DebugDraw2D * get_singleton()
Definition debug_draw_2d.h:91
PackedStringArray get_graph_names()
void begin_text_group(String group_title, int group_priority=0, Color group_color=Colors::white_smoke, bool show_title=true, int title_size=14, int text_size=12)
void set_config(Ref< DebugDraw2DConfig > _cfg)
The main singleton class that handles DebugDraw2D and DebugDraw3D.
Definition debug_draw_manager.h:54