class_mainloop.rst 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the MainLoop.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_MainLoop:
  5. MainLoop
  6. ========
  7. **Inherits:** :ref:`Object<class_Object>`
  8. **Inherited By:** :ref:`SceneTree<class_SceneTree>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Main loop is the abstract main loop base class.
  13. Methods
  14. -------
  15. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`_drop_files<class_MainLoop_method__drop_files>` **(** :ref:`PoolStringArray<class_PoolStringArray>` files, :ref:`int<class_int>` screen **)** virtual |
  17. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`_finalize<class_MainLoop_method__finalize>` **(** **)** virtual |
  19. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`_idle<class_MainLoop_method__idle>` **(** :ref:`float<class_float>` delta **)** virtual |
  21. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`_initialize<class_MainLoop_method__initialize>` **(** **)** virtual |
  23. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`_input_event<class_MainLoop_method__input_event>` **(** :ref:`InputEvent<class_InputEvent>` event **)** virtual |
  25. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`_input_text<class_MainLoop_method__input_text>` **(** :ref:`String<class_String>` text **)** virtual |
  27. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`_iteration<class_MainLoop_method__iteration>` **(** :ref:`float<class_float>` delta **)** virtual |
  29. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`finish<class_MainLoop_method_finish>` **(** **)** |
  31. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`idle<class_MainLoop_method_idle>` **(** :ref:`float<class_float>` delta **)** |
  33. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`init<class_MainLoop_method_init>` **(** **)** |
  35. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`input_event<class_MainLoop_method_input_event>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |
  37. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`input_text<class_MainLoop_method_input_text>` **(** :ref:`String<class_String>` text **)** |
  39. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`bool<class_bool>` | :ref:`iteration<class_MainLoop_method_iteration>` **(** :ref:`float<class_float>` delta **)** |
  41. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. Constants
  43. ---------
  44. .. _class_MainLoop_constant_NOTIFICATION_WM_MOUSE_ENTER:
  45. .. _class_MainLoop_constant_NOTIFICATION_WM_MOUSE_EXIT:
  46. .. _class_MainLoop_constant_NOTIFICATION_WM_FOCUS_IN:
  47. .. _class_MainLoop_constant_NOTIFICATION_WM_FOCUS_OUT:
  48. .. _class_MainLoop_constant_NOTIFICATION_WM_QUIT_REQUEST:
  49. .. _class_MainLoop_constant_NOTIFICATION_WM_GO_BACK_REQUEST:
  50. .. _class_MainLoop_constant_NOTIFICATION_WM_UNFOCUS_REQUEST:
  51. .. _class_MainLoop_constant_NOTIFICATION_OS_MEMORY_WARNING:
  52. .. _class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED:
  53. .. _class_MainLoop_constant_NOTIFICATION_WM_ABOUT:
  54. .. _class_MainLoop_constant_NOTIFICATION_CRASH:
  55. .. _class_MainLoop_constant_NOTIFICATION_OS_IME_UPDATE:
  56. - **NOTIFICATION_WM_MOUSE_ENTER** = **2**
  57. - **NOTIFICATION_WM_MOUSE_EXIT** = **3**
  58. - **NOTIFICATION_WM_FOCUS_IN** = **4**
  59. - **NOTIFICATION_WM_FOCUS_OUT** = **5**
  60. - **NOTIFICATION_WM_QUIT_REQUEST** = **6**
  61. - **NOTIFICATION_WM_GO_BACK_REQUEST** = **7**
  62. - **NOTIFICATION_WM_UNFOCUS_REQUEST** = **8**
  63. - **NOTIFICATION_OS_MEMORY_WARNING** = **9**
  64. - **NOTIFICATION_TRANSLATION_CHANGED** = **90**
  65. - **NOTIFICATION_WM_ABOUT** = **91**
  66. - **NOTIFICATION_CRASH** = **92**
  67. - **NOTIFICATION_OS_IME_UPDATE** = **93**
  68. Description
  69. -----------
  70. Main loop is the abstract main loop base class. All other main loop classes are derived from it. Upon application start, a ``MainLoop`` has to be provided to OS, else the application will exit. This happens automatically (and a :ref:`SceneTree<class_SceneTree>` is created), unless a main :ref:`Script<class_Script>` is supplied, which may or not create and return a ``MainLoop``.
  71. Method Descriptions
  72. -------------------
  73. .. _class_MainLoop_method__drop_files:
  74. - void **_drop_files** **(** :ref:`PoolStringArray<class_PoolStringArray>` files, :ref:`int<class_int>` screen **)** virtual
  75. .. _class_MainLoop_method__finalize:
  76. - void **_finalize** **(** **)** virtual
  77. Called before the program exits.
  78. .. _class_MainLoop_method__idle:
  79. - void **_idle** **(** :ref:`float<class_float>` delta **)** virtual
  80. Called each idle frame with time since last call as an only argument.
  81. .. _class_MainLoop_method__initialize:
  82. - void **_initialize** **(** **)** virtual
  83. Called once during initialization.
  84. .. _class_MainLoop_method__input_event:
  85. - void **_input_event** **(** :ref:`InputEvent<class_InputEvent>` event **)** virtual
  86. .. _class_MainLoop_method__input_text:
  87. - void **_input_text** **(** :ref:`String<class_String>` text **)** virtual
  88. .. _class_MainLoop_method__iteration:
  89. - void **_iteration** **(** :ref:`float<class_float>` delta **)** virtual
  90. .. _class_MainLoop_method_finish:
  91. - void **finish** **(** **)**
  92. .. _class_MainLoop_method_idle:
  93. - :ref:`bool<class_bool>` **idle** **(** :ref:`float<class_float>` delta **)**
  94. .. _class_MainLoop_method_init:
  95. - void **init** **(** **)**
  96. .. _class_MainLoop_method_input_event:
  97. - void **input_event** **(** :ref:`InputEvent<class_InputEvent>` event **)**
  98. .. _class_MainLoop_method_input_text:
  99. - void **input_text** **(** :ref:`String<class_String>` text **)**
  100. .. _class_MainLoop_method_iteration:
  101. - :ref:`bool<class_bool>` **iteration** **(** :ref:`float<class_float>` delta **)**