Debug Draw 3D 1.7.1
Draw 3D debug graphics and 2D overlays with this add-on.
Loading...
Searching...
No Matches

Singleton class for calling debugging 2D methods. More...

#include <debug_draw_2d.h>

Inheritance diagram for DebugDraw2D:

Public Member Functions

Color get_empty_color () const
NAPI void set_debug_enabled (const bool &_state)
NAPI bool is_debug_enabled () const
NAPI void set_config (Ref< DebugDraw2DConfig > _cfg)
NAPI Ref< DebugDraw2DConfigget_config () const
NAPI void set_custom_canvas (godot::Control *_canvas)
NAPI godot::Control * get_custom_canvas () const
NAPI Ref< DebugDraw2DStatsget_render_stats ()
NAPI void clear_all ()
void begin_text_group (godot::String group_title, int group_priority=0, godot::Color group_color=Colors::white_smoke, bool show_title=true, int title_size=-1, int text_size=-1)
NAPI void end_text_group ()
void set_text (godot::String key, godot::Variant value=godot::Variant(), int priority=0, godot::Color color_of_value=Colors::empty_color, real_t duration=-1)
NAPI void clear_texts ()

Static Public Member Functions

static DebugDraw2Dget_singleton ()

Detailed Description

Singleton class for calling debugging 2D methods.

Currently, this class supports drawing an overlay with text.

Member Function Documentation

◆ get_singleton()

DebugDraw2D * DebugDraw2D::get_singleton ( )
inlinestatic

Get singleton. Not available in GDScript.

◆ get_empty_color()

Color DebugDraw2D::get_empty_color ( ) const

Get the color that is used as the default parameter for draw_* calls.

◆ set_debug_enabled()

NAPI void DebugDraw2D::set_debug_enabled ( const bool & _state)

Set whether debug drawing works or not.

◆ set_config()

NAPI void DebugDraw2D::set_config ( Ref< DebugDraw2DConfig > _cfg)

Set the configuration global for everything in DebugDraw2D.

◆ get_config()

NAPI Ref< DebugDraw2DConfig > DebugDraw2D::get_config ( ) const

◆ set_custom_canvas()

NAPI void DebugDraw2D::set_custom_canvas ( godot::Control * _canvas)

Set a custom Control to be used as the canvas for drawing the graphic.

You can use any Control, even one that is in a different window.

◆ get_render_stats()

NAPI Ref< DebugDraw2DStats > DebugDraw2D::get_render_stats ( )

Returns the DebugDraw2DStats instance with the current statistics.

Some data can be delayed by 1 frame.

◆ clear_all()

NAPI void DebugDraw2D::clear_all ( )

Clear all 2D objects

◆ begin_text_group()

void DebugDraw2D::begin_text_group ( godot::String group_title,
int group_priority = 0,
godot::Color group_color = Colors::white_smoke,
bool show_title = true,
int title_size = -1,
int text_size = -1 )

Begin a text group to which all of the following text from DebugDraw2D.set_text will be added

Parameters
group_titleGroup title and ID
group_priorityGroup priority based on which groups will be sorted from top to bottom.
group_colorMain color of the group
show_titleWhether to show the title
title_sizeTitle font size
text_sizeText font size

◆ end_text_group()

NAPI void DebugDraw2D::end_text_group ( )

Ends the text group. Should be called after DebugDraw2D.begin_text_group.

If you need to create multiple groups, just call DebugDraw2D.begin_text_group again and this function at the end.

◆ set_text()

void DebugDraw2D::set_text ( godot::String key,
godot::Variant value = godot::Variant(),
int priority = 0,
godot::Color color_of_value = Colors::empty_color,
real_t duration = -1 )

Add or update text in an overlay

Parameters
keyLeft value if 'value' is set, otherwise the entire string is 'key'
valueValue of field
priorityPriority of this line. Lower value is higher position
color_of_valueValue color
durationExpiration time

◆ clear_texts()

NAPI void DebugDraw2D::clear_texts ( )

Clear all text


The documentation for this class was generated from the following file: