Debug Draw 3D (and 2D) 1.4.5
Draw 3D debug graphics and 2D overlays with this add-on.
Loading...
Searching...
No Matches
DebugDraw2DGraph Class Reference

Base class for drawing graphs. More...

#include <graphs.h>

Inheritance diagram for DebugDraw2DGraph:
DebugDraw2DFPSGraph

Public Types

enum  GraphPosition : int {
  POSITION_LEFT_TOP = 0 ,
  POSITION_RIGHT_TOP = 1 ,
  POSITION_LEFT_BOTTOM = 2 ,
  POSITION_RIGHT_BOTTOM = 3 ,
  POSITION_MAX
}
 
enum  GraphSide : int {
  SIDE_LEFT = 0 ,
  SIDE_TOP = 1 ,
  SIDE_RIGHT = 2 ,
  SIDE_BOTTOM = 3 ,
  SIDE_MAX
}
 
enum  TextFlags : int64_t {
  TEXT_CURRENT = 1 << 0 ,
  TEXT_AVG = 1 << 1 ,
  TEXT_MAX = 1 << 2 ,
  TEXT_MIN = 1 << 3 ,
  TEXT_ALL = TEXT_CURRENT | TEXT_AVG | TEXT_MAX | TEXT_MIN
}
 

Public Member Functions

StringName get_title () const
 
void set_enabled (const bool _state)
 
bool is_enabled () const
 
void set_upside_down (const bool _state)
 
bool is_upside_down () const
 
void set_show_title (const bool _state)
 
bool is_show_title () const
 
void set_show_text_flags (const BitField< TextFlags > _flags)
 
BitField< TextFlagsget_show_text_flags () const
 
void set_size (const Vector2i &_size)
 
Vector2i get_size () const
 
void set_buffer_size (const int _buf_size)
 
int get_buffer_size () const
 
void set_offset (const Vector2i &_offset)
 
Vector2i get_offset () const
 
void set_corner (const GraphPosition _position)
 
GraphPosition get_corner () const
 
void set_line_width (const real_t _width)
 
real_t get_line_width () const
 
void set_line_color (const Color &_new_color)
 
Color get_line_color () const
 
void set_background_color (const Color &_new_color)
 
Color get_background_color () const
 
void set_border_color (const Color &_new_color)
 
Color get_border_color () const
 
void set_text_suffix (const String &_suffix)
 
String get_text_suffix () const
 
void set_custom_font (const Ref< Font > _custom_font)
 
Ref< Font > get_custom_font () const
 
void set_title_size (const int _size)
 
int get_title_size () const
 
void set_text_size (const int _size)
 
int get_text_size () const
 
void set_title_color (const Color &_new_color)
 
Color get_title_color () const
 
void set_text_color (const Color &_new_color)
 
Color get_text_color () const
 
void set_text_precision (const int _precision)
 
int get_text_precision () const
 
void set_parent_graph (const StringName &_graph)
 
StringName get_parent_graph () const
 
void set_parent_graph_side (const GraphSide _side)
 
GraphSide get_parent_graph_side () const
 
virtual void set_data_getter (const Callable &_callable)
 
Callable get_data_getter () const
 
void set_parent (const StringName &_name, const GraphSide _side=GraphSide::SIDE_BOTTOM)
 

Detailed Description

Base class for drawing graphs.

Must be created via DebugDraw2D.create_graph.

Member Enumeration Documentation

◆ GraphPosition

Available graph positions

◆ GraphSide

Which side of the parent graph this graph joins.

◆ TextFlags

Flags for displaying text

Member Function Documentation

◆ get_title()

StringName DebugDraw2DGraph::get_title ( ) const

Get the graph title

◆ set_enabled()

void DebugDraw2DGraph::set_enabled ( const bool _state)

Set whether the graph is active

◆ set_upside_down()

void DebugDraw2DGraph::set_upside_down ( const bool _state)

Set the direction to which the graph line is moving

◆ set_show_title()

void DebugDraw2DGraph::set_show_title ( const bool _state)

Set whether to display the graph title

◆ set_show_text_flags()

void DebugDraw2DGraph::set_show_text_flags ( const BitField< TextFlags > _flags)

Set text display flags

◆ set_size()

void DebugDraw2DGraph::set_size ( const Vector2i & _size)

Set the graph size

◆ set_buffer_size()

void DebugDraw2DGraph::set_buffer_size ( const int _buf_size)

Set the buffer size

◆ set_offset()

void DebugDraw2DGraph::set_offset ( const Vector2i & _offset)

Set the offset from the corner

◆ set_corner()

void DebugDraw2DGraph::set_corner ( const GraphPosition _position)

Set the corner where the graph will be drawn. It only works if the parent graph is not set via DebugDraw2DGraph.set_parent_graph.

◆ set_line_width()

void DebugDraw2DGraph::set_line_width ( const real_t _width)

Set the line width

◆ set_line_color()

void DebugDraw2DGraph::set_line_color ( const Color & _new_color)

Set the line color

◆ set_background_color()

void DebugDraw2DGraph::set_background_color ( const Color & _new_color)

Set the background color

◆ set_border_color()

void DebugDraw2DGraph::set_border_color ( const Color & _new_color)

Set the border color

◆ set_text_suffix()

void DebugDraw2DGraph::set_text_suffix ( const String & _suffix)

Set the text to be displayed after the numeric value

◆ set_custom_font()

void DebugDraw2DGraph::set_custom_font ( const Ref< Font > _custom_font)

Set the text font

◆ set_title_size()

void DebugDraw2DGraph::set_title_size ( const int _size)

Set the title size

◆ set_text_size()

void DebugDraw2DGraph::set_text_size ( const int _size)

Set the text size

◆ set_title_color()

void DebugDraw2DGraph::set_title_color ( const Color & _new_color)

Set the title color

◆ set_text_color()

void DebugDraw2DGraph::set_text_color ( const Color & _new_color)

Set the text color

◆ set_text_precision()

void DebugDraw2DGraph::set_text_precision ( const int _precision)

Set the number of decimal places

◆ set_parent_graph()

void DebugDraw2DGraph::set_parent_graph ( const StringName & _graph)

Set the parent graph relative to which this graph will be drawn

◆ set_parent_graph_side()

void DebugDraw2DGraph::set_parent_graph_side ( const GraphSide _side)

Set the side of the parent graph relative to which this graph will be drawn. It only works if the parent graph is set via DebugDraw2DGraph.set_parent_graph

◆ set_data_getter()

virtual void DebugDraw2DGraph::set_data_getter ( const Callable & _callable)
virtual

Set a Callable that will be called every frame to get a new value

Reimplemented in DebugDraw2DFPSGraph.

◆ set_parent()

void DebugDraw2DGraph::set_parent ( const StringName & _name,
const GraphSide _side = GraphSide::SIDE_BOTTOM )

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