Base class for drawing graphs. More...
#include <graphs.h>
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< TextFlags > | get_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) |
Base class for drawing graphs.
Must be created via DebugDraw2D.create_graph.
enum DebugDraw2DGraph::GraphPosition : int |
Available graph positions
enum DebugDraw2DGraph::GraphSide : int |
Which side of the parent graph this graph joins.
enum DebugDraw2DGraph::TextFlags : int64_t |
Flags for displaying text
StringName DebugDraw2DGraph::get_title | ( | ) | const |
Get the graph title
void DebugDraw2DGraph::set_enabled | ( | const bool | _state | ) |
Set whether the graph is active
void DebugDraw2DGraph::set_upside_down | ( | const bool | _state | ) |
Set the direction to which the graph line is moving
void DebugDraw2DGraph::set_show_title | ( | const bool | _state | ) |
Set whether to display the graph title
void DebugDraw2DGraph::set_show_text_flags | ( | const BitField< TextFlags > | _flags | ) |
Set text display flags
void DebugDraw2DGraph::set_size | ( | const Vector2i & | _size | ) |
Set the graph size
void DebugDraw2DGraph::set_buffer_size | ( | const int | _buf_size | ) |
Set the buffer size
void DebugDraw2DGraph::set_offset | ( | const Vector2i & | _offset | ) |
Set the offset from the 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.
void DebugDraw2DGraph::set_line_width | ( | const real_t | _width | ) |
Set the line width
void DebugDraw2DGraph::set_line_color | ( | const Color & | _new_color | ) |
Set the line color
void DebugDraw2DGraph::set_background_color | ( | const Color & | _new_color | ) |
Set the background color
void DebugDraw2DGraph::set_border_color | ( | const Color & | _new_color | ) |
Set the border color
void DebugDraw2DGraph::set_text_suffix | ( | const String & | _suffix | ) |
Set the text to be displayed after the numeric value
void DebugDraw2DGraph::set_custom_font | ( | const Ref< Font > | _custom_font | ) |
Set the text font
void DebugDraw2DGraph::set_title_size | ( | const int | _size | ) |
Set the title size
void DebugDraw2DGraph::set_text_size | ( | const int | _size | ) |
Set the text size
void DebugDraw2DGraph::set_title_color | ( | const Color & | _new_color | ) |
Set the title color
void DebugDraw2DGraph::set_text_color | ( | const Color & | _new_color | ) |
Set the text color
void DebugDraw2DGraph::set_text_precision | ( | const int | _precision | ) |
Set the number of decimal places
void DebugDraw2DGraph::set_parent_graph | ( | const StringName & | _graph | ) |
Set the parent graph relative to which this graph will be drawn
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
|
virtual |
Set a Callable that will be called every frame to get a new value
Reimplemented in DebugDraw2DFPSGraph.
void DebugDraw2DGraph::set_parent | ( | const StringName & | _name, |
const GraphSide | _side = GraphSide::SIDE_BOTTOM ) |
Set DebugDraw2DGraph.set_parent_graph and DebugDraw2DGraph.set_parent_graph_side at the same time