EngineDebugger.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="EngineDebugger" inherits="Object" version="4.0">
  3. <brief_description>
  4. Exposes the internal debugger.
  5. </brief_description>
  6. <description>
  7. [EngineDebugger] handles the communication between the editor and the running game. It is active in the running game. Messages can be sent/received through it. It also manages the profilers.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="has_capture">
  13. <return type="bool" />
  14. <argument index="0" name="name" type="StringName" />
  15. <description>
  16. Returns [code]true[/code] if a capture with the given name is present otherwise [code]false[/code].
  17. </description>
  18. </method>
  19. <method name="has_profiler">
  20. <return type="bool" />
  21. <argument index="0" name="name" type="StringName" />
  22. <description>
  23. Returns [code]true[/code] if a profiler with the given name is present otherwise [code]false[/code].
  24. </description>
  25. </method>
  26. <method name="is_active">
  27. <return type="bool" />
  28. <description>
  29. Returns [code]true[/code] if the debugger is active otherwise [code]false[/code].
  30. </description>
  31. </method>
  32. <method name="is_profiling">
  33. <return type="bool" />
  34. <argument index="0" name="name" type="StringName" />
  35. <description>
  36. Returns [code]true[/code] if a profiler with the given name is present and active otherwise [code]false[/code].
  37. </description>
  38. </method>
  39. <method name="profiler_add_frame_data">
  40. <return type="void" />
  41. <argument index="0" name="name" type="StringName" />
  42. <argument index="1" name="data" type="Array" />
  43. <description>
  44. Calls the [code]add[/code] callable of the profiler with given [code]name[/code] and [code]data[/code].
  45. </description>
  46. </method>
  47. <method name="profiler_enable">
  48. <return type="void" />
  49. <argument index="0" name="name" type="StringName" />
  50. <argument index="1" name="enable" type="bool" />
  51. <argument index="2" name="arguments" type="Array" default="[]" />
  52. <description>
  53. Calls the [code]toggle[/code] callable of the profiler with given [code]name[/code] and [code]arguments[/code]. Enables/Disables the same profiler depending on [code]enable[/code] argument.
  54. </description>
  55. </method>
  56. <method name="register_message_capture">
  57. <return type="void" />
  58. <argument index="0" name="name" type="StringName" />
  59. <argument index="1" name="callable" type="Callable" />
  60. <description>
  61. Registers a message capture with given [code]name[/code]. If [code]name[/code] is "my_message" then messages starting with "my_message:" will be called with the given callable.
  62. Callable must accept a message string and a data array as argument. If the message and data are valid then callable must return [code]true[/code] otherwise [code]false[/code].
  63. </description>
  64. </method>
  65. <method name="register_profiler">
  66. <return type="void" />
  67. <argument index="0" name="name" type="StringName" />
  68. <argument index="1" name="toggle" type="Callable" />
  69. <argument index="2" name="add" type="Callable" />
  70. <argument index="3" name="tick" type="Callable" />
  71. <description>
  72. Registers a profiler with the given [code]name[/code].
  73. [code]toggle[/code] callable is called when the profiler is enabled/disabled. It must take an argument array as an argument.
  74. [code]add[/code] callable is called when data is added to profiler using [method EngineDebugger.profiler_add_frame_data]. It must take a data array as argument.
  75. [code]tick[/code] callable is called at every active profiler iteration. It must take frame time, idle time, physics time, and physics idle time as arguments.
  76. </description>
  77. </method>
  78. <method name="send_message">
  79. <return type="void" />
  80. <argument index="0" name="message" type="String" />
  81. <argument index="1" name="data" type="Array" />
  82. <description>
  83. Sends a message with given [code]message[/code] and [code]data[/code] array.
  84. </description>
  85. </method>
  86. <method name="unregister_message_capture">
  87. <return type="void" />
  88. <argument index="0" name="name" type="StringName" />
  89. <description>
  90. Unregisters the message capture with given [code]name[/code].
  91. </description>
  92. </method>
  93. <method name="unregister_profiler">
  94. <return type="void" />
  95. <argument index="0" name="name" type="StringName" />
  96. <description>
  97. Unregisters a profiler with given [code]name[/code].
  98. </description>
  99. </method>
  100. </methods>
  101. </class>