class_control.rst 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_Control:
  4. Control
  5. =======
  6. **Inherits:** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Inherited By:** :ref:`TextureRect<class_texturerect>`, :ref:`ColorRect<class_colorrect>`, :ref:`Label<class_label>`, :ref:`Tabs<class_tabs>`, :ref:`GraphEdit<class_graphedit>`, :ref:`VideoPlayer<class_videoplayer>`, :ref:`NinePatchRect<class_ninepatchrect>`, :ref:`LineEdit<class_lineedit>`, :ref:`Container<class_container>`, :ref:`TextEdit<class_textedit>`, :ref:`BaseButton<class_basebutton>`, :ref:`Popup<class_popup>`, :ref:`Tree<class_tree>`, :ref:`Separator<class_separator>`, :ref:`ReferenceRect<class_referencerect>`, :ref:`Panel<class_panel>`, :ref:`TabContainer<class_tabcontainer>`, :ref:`Range<class_range>`, :ref:`RichTextLabel<class_richtextlabel>`, :ref:`ItemList<class_itemlist>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Control is the base node for all the GUI components.
  12. Member Functions
  13. ----------------
  14. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`Vector2<class_vector2>` | :ref:`_get_minimum_size<class_Control__get_minimum_size>` **(** **)** virtual |
  16. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`_gui_input<class_Control__gui_input>` **(** :ref:`InputEvent<class_inputevent>` event **)** virtual |
  18. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`accept_event<class_Control_accept_event>` **(** **)** |
  20. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`add_color_override<class_Control_add_color_override>` **(** :ref:`String<class_string>` name, :ref:`Color<class_color>` color **)** |
  22. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`add_constant_override<class_Control_add_constant_override>` **(** :ref:`String<class_string>` name, :ref:`int<class_int>` constant **)** |
  24. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`add_font_override<class_Control_add_font_override>` **(** :ref:`String<class_string>` name, :ref:`Font<class_font>` font **)** |
  26. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`add_icon_override<class_Control_add_icon_override>` **(** :ref:`String<class_string>` name, :ref:`Texture<class_texture>` texture **)** |
  28. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`add_shader_override<class_Control_add_shader_override>` **(** :ref:`String<class_string>` name, :ref:`Shader<class_shader>` shader **)** |
  30. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`add_style_override<class_Control_add_style_override>` **(** :ref:`String<class_string>` name, :ref:`StyleBox<class_stylebox>` stylebox **)** |
  32. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`can_drop_data<class_Control_can_drop_data>` **(** :ref:`Vector2<class_vector2>` pos, :ref:`Variant<class_variant>` data **)** virtual |
  34. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`drop_data<class_Control_drop_data>` **(** :ref:`Vector2<class_vector2>` pos, :ref:`Variant<class_variant>` data **)** virtual |
  36. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`force_drag<class_Control_force_drag>` **(** :ref:`Variant<class_variant>` data, :ref:`Control<class_control>` preview **)** |
  38. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`float<class_float>` | :ref:`get_anchor<class_Control_get_anchor>` **(** :ref:`int<class_int>` margin **)** const |
  40. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Vector2<class_vector2>` | :ref:`get_begin<class_Control_get_begin>` **(** **)** const |
  42. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`Color<class_color>` | :ref:`get_color<class_Control_get_color>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const |
  44. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`Vector2<class_vector2>` | :ref:`get_combined_minimum_size<class_Control_get_combined_minimum_size>` **(** **)** const |
  46. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`int<class_int>` | :ref:`get_constant<class_Control_get_constant>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const |
  48. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`int<class_int>` | :ref:`get_cursor_shape<class_Control_get_cursor_shape>` **(** :ref:`Vector2<class_vector2>` pos=Vector2( 0, 0 ) **)** const |
  50. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`Vector2<class_vector2>` | :ref:`get_custom_minimum_size<class_Control_get_custom_minimum_size>` **(** **)** const |
  52. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`int<class_int>` | :ref:`get_default_cursor_shape<class_Control_get_default_cursor_shape>` **(** **)** const |
  54. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`Object<class_object>` | :ref:`get_drag_data<class_Control_get_drag_data>` **(** :ref:`Vector2<class_vector2>` pos **)** virtual |
  56. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`Vector2<class_vector2>` | :ref:`get_end<class_Control_get_end>` **(** **)** const |
  58. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`int<class_int>` | :ref:`get_focus_mode<class_Control_get_focus_mode>` **(** **)** const |
  60. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`NodePath<class_nodepath>` | :ref:`get_focus_neighbour<class_Control_get_focus_neighbour>` **(** :ref:`int<class_int>` margin **)** const |
  62. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`Control<class_control>` | :ref:`get_focus_owner<class_Control_get_focus_owner>` **(** **)** const |
  64. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`Font<class_font>` | :ref:`get_font<class_Control_get_font>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const |
  66. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Vector2<class_vector2>` | :ref:`get_global_position<class_Control_get_global_position>` **(** **)** const |
  68. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`Rect2<class_rect2>` | :ref:`get_global_rect<class_Control_get_global_rect>` **(** **)** const |
  70. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`int<class_int>` | :ref:`get_h_grow_direction<class_Control_get_h_grow_direction>` **(** **)** const |
  72. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`int<class_int>` | :ref:`get_h_size_flags<class_Control_get_h_size_flags>` **(** **)** const |
  74. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`Texture<class_texture>` | :ref:`get_icon<class_Control_get_icon>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const |
  76. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`float<class_float>` | :ref:`get_margin<class_Control_get_margin>` **(** :ref:`int<class_int>` margin **)** const |
  78. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`Vector2<class_vector2>` | :ref:`get_minimum_size<class_Control_get_minimum_size>` **(** **)** const |
  80. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`int<class_int>` | :ref:`get_mouse_filter<class_Control_get_mouse_filter>` **(** **)** const |
  82. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`Vector2<class_vector2>` | :ref:`get_parent_area_size<class_Control_get_parent_area_size>` **(** **)** const |
  84. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`Control<class_control>` | :ref:`get_parent_control<class_Control_get_parent_control>` **(** **)** const |
  86. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`Vector2<class_vector2>` | :ref:`get_pivot_offset<class_Control_get_pivot_offset>` **(** **)** const |
  88. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`Vector2<class_vector2>` | :ref:`get_position<class_Control_get_position>` **(** **)** const |
  90. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`Rect2<class_rect2>` | :ref:`get_rect<class_Control_get_rect>` **(** **)** const |
  92. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`float<class_float>` | :ref:`get_rotation<class_Control_get_rotation>` **(** **)** const |
  94. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`float<class_float>` | :ref:`get_rotation_deg<class_Control_get_rotation_deg>` **(** **)** const |
  96. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`Vector2<class_vector2>` | :ref:`get_scale<class_Control_get_scale>` **(** **)** const |
  98. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`Vector2<class_vector2>` | :ref:`get_size<class_Control_get_size>` **(** **)** const |
  100. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`float<class_float>` | :ref:`get_stretch_ratio<class_Control_get_stretch_ratio>` **(** **)** const |
  102. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`StyleBox<class_stylebox>` | :ref:`get_stylebox<class_Control_get_stylebox>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const |
  104. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`Theme<class_theme>` | :ref:`get_theme<class_Control_get_theme>` **(** **)** const |
  106. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`String<class_string>` | :ref:`get_tooltip<class_Control_get_tooltip>` **(** :ref:`Vector2<class_vector2>` atpos=Vector2( 0, 0 ) **)** const |
  108. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`int<class_int>` | :ref:`get_v_grow_direction<class_Control_get_v_grow_direction>` **(** **)** const |
  110. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`int<class_int>` | :ref:`get_v_size_flags<class_Control_get_v_size_flags>` **(** **)** const |
  112. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`grab_click_focus<class_Control_grab_click_focus>` **(** **)** |
  114. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`grab_focus<class_Control_grab_focus>` **(** **)** |
  116. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`bool<class_bool>` | :ref:`has_color<class_Control_has_color>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const |
  118. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`bool<class_bool>` | :ref:`has_color_override<class_Control_has_color_override>` **(** :ref:`String<class_string>` name **)** const |
  120. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`bool<class_bool>` | :ref:`has_constant<class_Control_has_constant>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const |
  122. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`bool<class_bool>` | :ref:`has_constant_override<class_Control_has_constant_override>` **(** :ref:`String<class_string>` name **)** const |
  124. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`bool<class_bool>` | :ref:`has_focus<class_Control_has_focus>` **(** **)** const |
  126. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`bool<class_bool>` | :ref:`has_font<class_Control_has_font>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const |
  128. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`bool<class_bool>` | :ref:`has_font_override<class_Control_has_font_override>` **(** :ref:`String<class_string>` name **)** const |
  130. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`bool<class_bool>` | :ref:`has_icon<class_Control_has_icon>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const |
  132. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`bool<class_bool>` | :ref:`has_icon_override<class_Control_has_icon_override>` **(** :ref:`String<class_string>` name **)** const |
  134. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`bool<class_bool>` | :ref:`has_point<class_Control_has_point>` **(** :ref:`Vector2<class_vector2>` point **)** virtual |
  136. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`bool<class_bool>` | :ref:`has_stylebox<class_Control_has_stylebox>` **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const |
  138. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | :ref:`bool<class_bool>` | :ref:`has_stylebox_override<class_Control_has_stylebox_override>` **(** :ref:`String<class_string>` name **)** const |
  140. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | :ref:`bool<class_bool>` | :ref:`is_clipping_contents<class_Control_is_clipping_contents>` **(** **)** |
  142. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | void | :ref:`minimum_size_changed<class_Control_minimum_size_changed>` **(** **)** |
  144. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | void | :ref:`release_focus<class_Control_release_focus>` **(** **)** |
  146. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | void | :ref:`set_anchor<class_Control_set_anchor>` **(** :ref:`int<class_int>` margin, :ref:`float<class_float>` anchor, :ref:`bool<class_bool>` keep_margin=false, :ref:`bool<class_bool>` push_opposite_anchor=true **)** |
  148. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | void | :ref:`set_anchor_and_margin<class_Control_set_anchor_and_margin>` **(** :ref:`int<class_int>` margin, :ref:`float<class_float>` anchor, :ref:`float<class_float>` offset, :ref:`bool<class_bool>` push_opposite_anchor=false **)** |
  150. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | void | :ref:`set_anchors_preset<class_Control_set_anchors_preset>` **(** :ref:`int<class_int>` preset, :ref:`bool<class_bool>` keep_margin=false **)** |
  152. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | void | :ref:`set_area_as_parent_rect<class_Control_set_area_as_parent_rect>` **(** :ref:`int<class_int>` margin=0 **)** |
  154. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | void | :ref:`set_begin<class_Control_set_begin>` **(** :ref:`Vector2<class_vector2>` pos **)** |
  156. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | void | :ref:`set_clip_contents<class_Control_set_clip_contents>` **(** :ref:`bool<class_bool>` enable **)** |
  158. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | void | :ref:`set_custom_minimum_size<class_Control_set_custom_minimum_size>` **(** :ref:`Vector2<class_vector2>` size **)** |
  160. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | void | :ref:`set_default_cursor_shape<class_Control_set_default_cursor_shape>` **(** :ref:`int<class_int>` shape **)** |
  162. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | void | :ref:`set_drag_forwarding<class_Control_set_drag_forwarding>` **(** :ref:`Control<class_control>` target **)** |
  164. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | void | :ref:`set_drag_preview<class_Control_set_drag_preview>` **(** :ref:`Control<class_control>` control **)** |
  166. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | void | :ref:`set_end<class_Control_set_end>` **(** :ref:`Vector2<class_vector2>` pos **)** |
  168. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | void | :ref:`set_focus_mode<class_Control_set_focus_mode>` **(** :ref:`int<class_int>` mode **)** |
  170. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | void | :ref:`set_focus_neighbour<class_Control_set_focus_neighbour>` **(** :ref:`int<class_int>` margin, :ref:`NodePath<class_nodepath>` neighbour **)** |
  172. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | void | :ref:`set_global_position<class_Control_set_global_position>` **(** :ref:`Vector2<class_vector2>` pos **)** |
  174. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | void | :ref:`set_h_grow_direction<class_Control_set_h_grow_direction>` **(** :ref:`int<class_int>` direction **)** |
  176. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | void | :ref:`set_h_size_flags<class_Control_set_h_size_flags>` **(** :ref:`int<class_int>` flags **)** |
  178. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | void | :ref:`set_margin<class_Control_set_margin>` **(** :ref:`int<class_int>` margin, :ref:`float<class_float>` offset **)** |
  180. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | void | :ref:`set_mouse_filter<class_Control_set_mouse_filter>` **(** :ref:`int<class_int>` filter **)** |
  182. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | void | :ref:`set_pivot_offset<class_Control_set_pivot_offset>` **(** :ref:`Vector2<class_vector2>` pivot_offset **)** |
  184. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | void | :ref:`set_position<class_Control_set_position>` **(** :ref:`Vector2<class_vector2>` pos **)** |
  186. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | void | :ref:`set_rotation<class_Control_set_rotation>` **(** :ref:`float<class_float>` radians **)** |
  188. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | void | :ref:`set_rotation_deg<class_Control_set_rotation_deg>` **(** :ref:`float<class_float>` degrees **)** |
  190. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | void | :ref:`set_scale<class_Control_set_scale>` **(** :ref:`Vector2<class_vector2>` scale **)** |
  192. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | void | :ref:`set_size<class_Control_set_size>` **(** :ref:`Vector2<class_vector2>` size **)** |
  194. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. | void | :ref:`set_stretch_ratio<class_Control_set_stretch_ratio>` **(** :ref:`float<class_float>` ratio **)** |
  196. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  197. | void | :ref:`set_theme<class_Control_set_theme>` **(** :ref:`Theme<class_theme>` theme **)** |
  198. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  199. | void | :ref:`set_tooltip<class_Control_set_tooltip>` **(** :ref:`String<class_string>` tooltip **)** |
  200. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  201. | void | :ref:`set_v_grow_direction<class_Control_set_v_grow_direction>` **(** :ref:`int<class_int>` direction **)** |
  202. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  203. | void | :ref:`set_v_size_flags<class_Control_set_v_size_flags>` **(** :ref:`int<class_int>` flags **)** |
  204. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  205. | void | :ref:`show_modal<class_Control_show_modal>` **(** :ref:`bool<class_bool>` exclusive=false **)** |
  206. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  207. | void | :ref:`warp_mouse<class_Control_warp_mouse>` **(** :ref:`Vector2<class_vector2>` to_pos **)** |
  208. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  209. Signals
  210. -------
  211. - **focus_entered** **(** **)**
  212. Emitted when keyboard focus is gained.
  213. - **focus_exited** **(** **)**
  214. Emitted when the keyboard focus is lost.
  215. - **gui_input** **(** :ref:`Object<class_object>` ev **)**
  216. - **minimum_size_changed** **(** **)**
  217. Emitted when the minimum size of the control changed.
  218. - **modal_closed** **(** **)**
  219. - **mouse_entered** **(** **)**
  220. Emitted when the mouse enters the control area.
  221. - **mouse_exited** **(** **)**
  222. Emitted when the mouse left the control area.
  223. - **resized** **(** **)**
  224. Emitted when the control changed size.
  225. - **size_flags_changed** **(** **)**
  226. Emitted when the size flags changed.
  227. Member Variables
  228. ----------------
  229. - :ref:`float<class_float>` **anchor_bottom**
  230. - :ref:`float<class_float>` **anchor_left**
  231. - :ref:`float<class_float>` **anchor_right**
  232. - :ref:`float<class_float>` **anchor_top**
  233. - :ref:`NodePath<class_nodepath>` **focus_neighbour_bottom**
  234. - :ref:`NodePath<class_nodepath>` **focus_neighbour_left**
  235. - :ref:`NodePath<class_nodepath>` **focus_neighbour_right**
  236. - :ref:`NodePath<class_nodepath>` **focus_neighbour_top**
  237. - :ref:`int<class_int>` **grow_horizontal**
  238. - :ref:`int<class_int>` **grow_vertical**
  239. - :ref:`String<class_string>` **hint_tooltip**
  240. - :ref:`float<class_float>` **margin_bottom**
  241. - :ref:`float<class_float>` **margin_left**
  242. - :ref:`float<class_float>` **margin_right**
  243. - :ref:`float<class_float>` **margin_top**
  244. - :ref:`int<class_int>` **mouse_filter**
  245. - :ref:`bool<class_bool>` **rect_clip_content**
  246. - :ref:`Vector2<class_vector2>` **rect_min_size**
  247. - :ref:`Vector2<class_vector2>` **rect_pivot_offset**
  248. - :ref:`Vector2<class_vector2>` **rect_position**
  249. - :ref:`float<class_float>` **rect_rotation**
  250. - :ref:`Vector2<class_vector2>` **rect_scale**
  251. - :ref:`Vector2<class_vector2>` **rect_size**
  252. - :ref:`int<class_int>` **size_flags_horizontal**
  253. - :ref:`float<class_float>` **size_flags_stretch_ratio**
  254. - :ref:`int<class_int>` **size_flags_vertical**
  255. - :ref:`Theme<class_theme>` **theme**
  256. Numeric Constants
  257. -----------------
  258. - **FOCUS_NONE** = **0** --- Control can't acquire focus.
  259. - **FOCUS_CLICK** = **1** --- Control can acquire focus only if clicked.
  260. - **FOCUS_ALL** = **2** --- Control can acquire focus if clicked, or by pressing TAB/Directionals in the keyboard from another Control.
  261. - **NOTIFICATION_RESIZED** = **40** --- Control changed size (get_size() reports the new size).
  262. - **NOTIFICATION_MOUSE_ENTER** = **41** --- Mouse pointer entered the area of the Control.
  263. - **NOTIFICATION_MOUSE_EXIT** = **42** --- Mouse pointer exited the area of the Control.
  264. - **NOTIFICATION_FOCUS_ENTER** = **43** --- Control gained focus.
  265. - **NOTIFICATION_FOCUS_EXIT** = **44** --- Control lost focus.
  266. - **NOTIFICATION_THEME_CHANGED** = **45** --- Theme changed. Redrawing is desired.
  267. - **NOTIFICATION_MODAL_CLOSE** = **46** --- Modal control was closed.
  268. - **CURSOR_ARROW** = **0**
  269. - **CURSOR_IBEAM** = **1**
  270. - **CURSOR_POINTING_HAND** = **2**
  271. - **CURSOR_CROSS** = **3**
  272. - **CURSOR_WAIT** = **4**
  273. - **CURSOR_BUSY** = **5**
  274. - **CURSOR_DRAG** = **6**
  275. - **CURSOR_CAN_DROP** = **7**
  276. - **CURSOR_FORBIDDEN** = **8**
  277. - **CURSOR_VSIZE** = **9**
  278. - **CURSOR_HSIZE** = **10**
  279. - **CURSOR_BDIAGSIZE** = **11**
  280. - **CURSOR_FDIAGSIZE** = **12**
  281. - **CURSOR_MOVE** = **13**
  282. - **CURSOR_VSPLIT** = **14**
  283. - **CURSOR_HSPLIT** = **15**
  284. - **CURSOR_HELP** = **16**
  285. - **PRESET_TOP_LEFT** = **0**
  286. - **PRESET_TOP_RIGHT** = **1**
  287. - **PRESET_BOTTOM_LEFT** = **2**
  288. - **PRESET_BOTTOM_RIGHT** = **3**
  289. - **PRESET_CENTER_LEFT** = **4**
  290. - **PRESET_CENTER_TOP** = **5**
  291. - **PRESET_CENTER_RIGHT** = **6**
  292. - **PRESET_CENTER_BOTTOM** = **7**
  293. - **PRESET_CENTER** = **8**
  294. - **PRESET_LEFT_WIDE** = **9**
  295. - **PRESET_TOP_WIDE** = **10**
  296. - **PRESET_RIGHT_WIDE** = **11**
  297. - **PRESET_BOTTOM_WIDE** = **12**
  298. - **PRESET_VCENTER_WIDE** = **13**
  299. - **PRESET_HCENTER_WIDE** = **14**
  300. - **PRESET_WIDE** = **15**
  301. - **SIZE_EXPAND** = **2**
  302. - **SIZE_FILL** = **1**
  303. - **SIZE_EXPAND_FILL** = **3**
  304. - **SIZE_SHRINK_CENTER** = **4**
  305. - **SIZE_SHRINK_END** = **8**
  306. - **MOUSE_FILTER_STOP** = **0**
  307. - **MOUSE_FILTER_PASS** = **1**
  308. - **MOUSE_FILTER_IGNORE** = **2**
  309. - **GROW_DIRECTION_BEGIN** = **0**
  310. - **GROW_DIRECTION_END** = **1**
  311. - **ANCHOR_BEGIN** = **0** --- X is relative to MARGIN_LEFT, Y is relative to MARGIN_TOP.
  312. - **ANCHOR_END** = **1** --- X is relative to -MARGIN_RIGHT, Y is relative to -MARGIN_BOTTOM.
  313. Description
  314. -----------
  315. Control is the base class Node for all the GUI components. Every GUI component inherits from it, directly or indirectly. In this way, sections of the scene tree made of contiguous control nodes, become user interfaces.
  316. Controls are relative to the parent position and size by using anchors and margins. This ensures that they can adapt easily in most situation to changing dialog and screen sizes. When more flexibility is desired, :ref:`Container<class_container>` derived nodes can be used.
  317. Anchors work by defining which margin do they follow, and a value relative to it. Allowed anchoring modes are ANCHOR_BEGIN, where the margin is relative to the top or left margins of the parent (in pixels), ANCHOR_END for the right and bottom margins of the parent and ANCHOR_RATIO, which is a ratio from 0 to 1 in the parent range.
  318. Input device events are first sent to the root controls via the :ref:`Node._input<class_Node__input>`, which distribute it through the tree, then delivers them to the adequate one (under cursor or keyboard focus based) by calling :ref:`MainLoop._input_event<class_MainLoop__input_event>`. There is no need to enable input processing on controls to receive such events. To ensure that no one else will receive the event (not even :ref:`Node._unhandled_input<class_Node__unhandled_input>`), the control can accept it by calling :ref:`accept_event<class_Control_accept_event>`.
  319. Only one control can hold the keyboard focus (receiving keyboard events), for that the control must define the focus mode with :ref:`set_focus_mode<class_Control_set_focus_mode>`. Focus is lost when another control gains it, or the current focus owner is hidden.
  320. It is sometimes desired for a control to ignore mouse/pointer events. This is often the case when placing other controls on top of a button, in such cases. Calling :ref:`set_ignore_mouse<class_Control_set_ignore_mouse>` enables this function.
  321. Finally, controls are skinned according to a :ref:`Theme<class_theme>`. Setting a :ref:`Theme<class_theme>` on a control will propagate all the skinning down the tree. Optionally, skinning can be overridden per each control by calling the add\_\*_override functions, or from the editor.
  322. Member Function Description
  323. ---------------------------
  324. .. _class_Control__get_minimum_size:
  325. - :ref:`Vector2<class_vector2>` **_get_minimum_size** **(** **)** virtual
  326. Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size.
  327. .. _class_Control__gui_input:
  328. - void **_gui_input** **(** :ref:`InputEvent<class_inputevent>` event **)** virtual
  329. .. _class_Control_accept_event:
  330. - void **accept_event** **(** **)**
  331. Handles the event, no other control will receive it and it will not be sent to nodes waiting on :ref:`Node._unhandled_input<class_Node__unhandled_input>` or :ref:`Node._unhandled_key_input<class_Node__unhandled_key_input>`.
  332. .. _class_Control_add_color_override:
  333. - void **add_color_override** **(** :ref:`String<class_string>` name, :ref:`Color<class_color>` color **)**
  334. .. _class_Control_add_constant_override:
  335. - void **add_constant_override** **(** :ref:`String<class_string>` name, :ref:`int<class_int>` constant **)**
  336. Override a single constant (integer) in the theme of this Control. If constant equals Theme.INVALID_CONSTANT, override is cleared.
  337. .. _class_Control_add_font_override:
  338. - void **add_font_override** **(** :ref:`String<class_string>` name, :ref:`Font<class_font>` font **)**
  339. Override a single font (font) in the theme of this Control. If font is empty, override is cleared.
  340. .. _class_Control_add_icon_override:
  341. - void **add_icon_override** **(** :ref:`String<class_string>` name, :ref:`Texture<class_texture>` texture **)**
  342. Override a single icon (:ref:`Texture<class_texture>`) in the theme of this Control. If texture is empty, override is cleared.
  343. .. _class_Control_add_shader_override:
  344. - void **add_shader_override** **(** :ref:`String<class_string>` name, :ref:`Shader<class_shader>` shader **)**
  345. .. _class_Control_add_style_override:
  346. - void **add_style_override** **(** :ref:`String<class_string>` name, :ref:`StyleBox<class_stylebox>` stylebox **)**
  347. Override a single stylebox (Stylebox) in the theme of this Control. If stylebox is empty, override is cleared.
  348. .. _class_Control_can_drop_data:
  349. - :ref:`bool<class_bool>` **can_drop_data** **(** :ref:`Vector2<class_vector2>` pos, :ref:`Variant<class_variant>` data **)** virtual
  350. .. _class_Control_drop_data:
  351. - void **drop_data** **(** :ref:`Vector2<class_vector2>` pos, :ref:`Variant<class_variant>` data **)** virtual
  352. .. _class_Control_force_drag:
  353. - void **force_drag** **(** :ref:`Variant<class_variant>` data, :ref:`Control<class_control>` preview **)**
  354. .. _class_Control_get_anchor:
  355. - :ref:`float<class_float>` **get_anchor** **(** :ref:`int<class_int>` margin **)** const
  356. Return the anchor type (ANCHOR_BEGIN, ANCHOR_END, ANCHOR_RATIO) for a given margin (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM).
  357. .. _class_Control_get_begin:
  358. - :ref:`Vector2<class_vector2>` **get_begin** **(** **)** const
  359. .. _class_Control_get_color:
  360. - :ref:`Color<class_color>` **get_color** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const
  361. .. _class_Control_get_combined_minimum_size:
  362. - :ref:`Vector2<class_vector2>` **get_combined_minimum_size** **(** **)** const
  363. .. _class_Control_get_constant:
  364. - :ref:`int<class_int>` **get_constant** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const
  365. .. _class_Control_get_cursor_shape:
  366. - :ref:`int<class_int>` **get_cursor_shape** **(** :ref:`Vector2<class_vector2>` pos=Vector2( 0, 0 ) **)** const
  367. Return the cursor shape at a certain position in the control.
  368. .. _class_Control_get_custom_minimum_size:
  369. - :ref:`Vector2<class_vector2>` **get_custom_minimum_size** **(** **)** const
  370. .. _class_Control_get_default_cursor_shape:
  371. - :ref:`int<class_int>` **get_default_cursor_shape** **(** **)** const
  372. Return the default cursor shape for this control. See enum CURSOR\_\* for the list of shapes.
  373. .. _class_Control_get_drag_data:
  374. - :ref:`Object<class_object>` **get_drag_data** **(** :ref:`Vector2<class_vector2>` pos **)** virtual
  375. .. _class_Control_get_end:
  376. - :ref:`Vector2<class_vector2>` **get_end** **(** **)** const
  377. Returns MARGIN_LEFT and MARGIN_TOP at the same time. This is a helper (see :ref:`set_margin<class_Control_set_margin>`).
  378. .. _class_Control_get_focus_mode:
  379. - :ref:`int<class_int>` **get_focus_mode** **(** **)** const
  380. Returns the focus access mode for the control (FOCUS_NONE, FOCUS_CLICK, FOCUS_ALL) (see :ref:`set_focus_mode<class_Control_set_focus_mode>`).
  381. .. _class_Control_get_focus_neighbour:
  382. - :ref:`NodePath<class_nodepath>` **get_focus_neighbour** **(** :ref:`int<class_int>` margin **)** const
  383. Return the forced neighbour for moving the input focus to. When pressing TAB or directional/joypad directions focus is moved to the next control in that direction. However, the neighbour to move to can be forced with this function.
  384. .. _class_Control_get_focus_owner:
  385. - :ref:`Control<class_control>` **get_focus_owner** **(** **)** const
  386. Return which control is owning the keyboard focus, or null if no one.
  387. .. _class_Control_get_font:
  388. - :ref:`Font<class_font>` **get_font** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const
  389. .. _class_Control_get_global_position:
  390. - :ref:`Vector2<class_vector2>` **get_global_position** **(** **)** const
  391. Returns the Control position, relative to the top-left corner of the parent Control and independent of the anchor mode.
  392. .. _class_Control_get_global_rect:
  393. - :ref:`Rect2<class_rect2>` **get_global_rect** **(** **)** const
  394. Return position and size of the Control, relative to the top-left corner of the *window* Control. This is a helper (see :ref:`get_global_position<class_Control_get_global_position>`, :ref:`get_size<class_Control_get_size>`).
  395. .. _class_Control_get_h_grow_direction:
  396. - :ref:`int<class_int>` **get_h_grow_direction** **(** **)** const
  397. .. _class_Control_get_h_size_flags:
  398. - :ref:`int<class_int>` **get_h_size_flags** **(** **)** const
  399. Hint for containers, return horizontal positioning flags.
  400. .. _class_Control_get_icon:
  401. - :ref:`Texture<class_texture>` **get_icon** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const
  402. .. _class_Control_get_margin:
  403. - :ref:`float<class_float>` **get_margin** **(** :ref:`int<class_int>` margin **)** const
  404. Return a margin offset. Margin can be one of (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). Offset value being returned depends on the anchor mode.
  405. .. _class_Control_get_minimum_size:
  406. - :ref:`Vector2<class_vector2>` **get_minimum_size** **(** **)** const
  407. Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size.
  408. .. _class_Control_get_mouse_filter:
  409. - :ref:`int<class_int>` **get_mouse_filter** **(** **)** const
  410. Return when the control is ignoring mouse events (even touchpad events send mouse events).
  411. .. _class_Control_get_parent_area_size:
  412. - :ref:`Vector2<class_vector2>` **get_parent_area_size** **(** **)** const
  413. .. _class_Control_get_parent_control:
  414. - :ref:`Control<class_control>` **get_parent_control** **(** **)** const
  415. .. _class_Control_get_pivot_offset:
  416. - :ref:`Vector2<class_vector2>` **get_pivot_offset** **(** **)** const
  417. .. _class_Control_get_position:
  418. - :ref:`Vector2<class_vector2>` **get_position** **(** **)** const
  419. Returns the Control position, relative to the top-left corner of the parent Control and independent of the anchor mode.
  420. .. _class_Control_get_rect:
  421. - :ref:`Rect2<class_rect2>` **get_rect** **(** **)** const
  422. Return position and size of the Control, relative to the top-left corner of the parent Control. This is a helper (see :ref:`get_position<class_Control_get_position>`, :ref:`get_size<class_Control_get_size>`).
  423. .. _class_Control_get_rotation:
  424. - :ref:`float<class_float>` **get_rotation** **(** **)** const
  425. Return the rotation (in radians)
  426. .. _class_Control_get_rotation_deg:
  427. - :ref:`float<class_float>` **get_rotation_deg** **(** **)** const
  428. Return the rotation (in degrees)
  429. .. _class_Control_get_scale:
  430. - :ref:`Vector2<class_vector2>` **get_scale** **(** **)** const
  431. .. _class_Control_get_size:
  432. - :ref:`Vector2<class_vector2>` **get_size** **(** **)** const
  433. Returns the size of the Control, computed from all margins, however the size returned will **never be smaller than the minimum size reported by** :ref:`get_minimum_size<class_Control_get_minimum_size>`. This means that even if end position of the Control rectangle is smaller than the begin position, the Control will still display and interact correctly. (see description, :ref:`get_minimum_size<class_Control_get_minimum_size>`, :ref:`set_margin<class_Control_set_margin>`, :ref:`set_anchor<class_Control_set_anchor>`).
  434. .. _class_Control_get_stretch_ratio:
  435. - :ref:`float<class_float>` **get_stretch_ratio** **(** **)** const
  436. Hint for containers, return the stretch ratio. This value is relative to other stretch ratio, so if this control has 2 and another has 1, this one will be twice as big.
  437. .. _class_Control_get_stylebox:
  438. - :ref:`StyleBox<class_stylebox>` **get_stylebox** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const
  439. .. _class_Control_get_theme:
  440. - :ref:`Theme<class_theme>` **get_theme** **(** **)** const
  441. Return a :ref:`Theme<class_theme>` override, if one exists (see :ref:`set_theme<class_Control_set_theme>`).
  442. .. _class_Control_get_tooltip:
  443. - :ref:`String<class_string>` **get_tooltip** **(** :ref:`Vector2<class_vector2>` atpos=Vector2( 0, 0 ) **)** const
  444. Return the tooltip, which will appear when the cursor is resting over this control.
  445. .. _class_Control_get_v_grow_direction:
  446. - :ref:`int<class_int>` **get_v_grow_direction** **(** **)** const
  447. .. _class_Control_get_v_size_flags:
  448. - :ref:`int<class_int>` **get_v_size_flags** **(** **)** const
  449. Hint for containers, return vertical positioning flags.
  450. .. _class_Control_grab_click_focus:
  451. - void **grab_click_focus** **(** **)**
  452. .. _class_Control_grab_focus:
  453. - void **grab_focus** **(** **)**
  454. Steal the focus from another control and become the focused control (see :ref:`set_focus_mode<class_Control_set_focus_mode>`).
  455. .. _class_Control_has_color:
  456. - :ref:`bool<class_bool>` **has_color** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const
  457. .. _class_Control_has_color_override:
  458. - :ref:`bool<class_bool>` **has_color_override** **(** :ref:`String<class_string>` name **)** const
  459. .. _class_Control_has_constant:
  460. - :ref:`bool<class_bool>` **has_constant** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const
  461. .. _class_Control_has_constant_override:
  462. - :ref:`bool<class_bool>` **has_constant_override** **(** :ref:`String<class_string>` name **)** const
  463. .. _class_Control_has_focus:
  464. - :ref:`bool<class_bool>` **has_focus** **(** **)** const
  465. Return whether the Control is the current focused control (see :ref:`set_focus_mode<class_Control_set_focus_mode>`).
  466. .. _class_Control_has_font:
  467. - :ref:`bool<class_bool>` **has_font** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const
  468. .. _class_Control_has_font_override:
  469. - :ref:`bool<class_bool>` **has_font_override** **(** :ref:`String<class_string>` name **)** const
  470. .. _class_Control_has_icon:
  471. - :ref:`bool<class_bool>` **has_icon** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const
  472. .. _class_Control_has_icon_override:
  473. - :ref:`bool<class_bool>` **has_icon_override** **(** :ref:`String<class_string>` name **)** const
  474. .. _class_Control_has_point:
  475. - :ref:`bool<class_bool>` **has_point** **(** :ref:`Vector2<class_vector2>` point **)** virtual
  476. .. _class_Control_has_stylebox:
  477. - :ref:`bool<class_bool>` **has_stylebox** **(** :ref:`String<class_string>` name, :ref:`String<class_string>` type="" **)** const
  478. .. _class_Control_has_stylebox_override:
  479. - :ref:`bool<class_bool>` **has_stylebox_override** **(** :ref:`String<class_string>` name **)** const
  480. .. _class_Control_is_clipping_contents:
  481. - :ref:`bool<class_bool>` **is_clipping_contents** **(** **)**
  482. .. _class_Control_minimum_size_changed:
  483. - void **minimum_size_changed** **(** **)**
  484. .. _class_Control_release_focus:
  485. - void **release_focus** **(** **)**
  486. Give up the focus, no other control will be able to receive keyboard input.
  487. .. _class_Control_set_anchor:
  488. - void **set_anchor** **(** :ref:`int<class_int>` margin, :ref:`float<class_float>` anchor, :ref:`bool<class_bool>` keep_margin=false, :ref:`bool<class_bool>` push_opposite_anchor=true **)**
  489. .. _class_Control_set_anchor_and_margin:
  490. - void **set_anchor_and_margin** **(** :ref:`int<class_int>` margin, :ref:`float<class_float>` anchor, :ref:`float<class_float>` offset, :ref:`bool<class_bool>` push_opposite_anchor=false **)**
  491. .. _class_Control_set_anchors_preset:
  492. - void **set_anchors_preset** **(** :ref:`int<class_int>` preset, :ref:`bool<class_bool>` keep_margin=false **)**
  493. .. _class_Control_set_area_as_parent_rect:
  494. - void **set_area_as_parent_rect** **(** :ref:`int<class_int>` margin=0 **)**
  495. Change all margins and anchors, so this Control always takes up the same area as the parent Control. This is a helper (see :ref:`set_anchor<class_Control_set_anchor>`, :ref:`set_margin<class_Control_set_margin>`).
  496. .. _class_Control_set_begin:
  497. - void **set_begin** **(** :ref:`Vector2<class_vector2>` pos **)**
  498. Sets MARGIN_LEFT and MARGIN_TOP at the same time. This is a helper (see :ref:`set_margin<class_Control_set_margin>`).
  499. .. _class_Control_set_clip_contents:
  500. - void **set_clip_contents** **(** :ref:`bool<class_bool>` enable **)**
  501. .. _class_Control_set_custom_minimum_size:
  502. - void **set_custom_minimum_size** **(** :ref:`Vector2<class_vector2>` size **)**
  503. .. _class_Control_set_default_cursor_shape:
  504. - void **set_default_cursor_shape** **(** :ref:`int<class_int>` shape **)**
  505. Set the default cursor shape for this control. See enum CURSOR\_\* for the list of shapes.
  506. .. _class_Control_set_drag_forwarding:
  507. - void **set_drag_forwarding** **(** :ref:`Control<class_control>` target **)**
  508. .. _class_Control_set_drag_preview:
  509. - void **set_drag_preview** **(** :ref:`Control<class_control>` control **)**
  510. .. _class_Control_set_end:
  511. - void **set_end** **(** :ref:`Vector2<class_vector2>` pos **)**
  512. Sets MARGIN_RIGHT and MARGIN_BOTTOM at the same time. This is a helper (see :ref:`set_margin<class_Control_set_margin>`).
  513. .. _class_Control_set_focus_mode:
  514. - void **set_focus_mode** **(** :ref:`int<class_int>` mode **)**
  515. Set the focus access mode for the control (FOCUS_NONE, FOCUS_CLICK, FOCUS_ALL). Only one Control can be focused at the same time, and it will receive keyboard signals.
  516. .. _class_Control_set_focus_neighbour:
  517. - void **set_focus_neighbour** **(** :ref:`int<class_int>` margin, :ref:`NodePath<class_nodepath>` neighbour **)**
  518. Force a neighbour for moving the input focus to. When pressing TAB or directional/joypad directions focus is moved to the next control in that direction. However, the neighbour to move to can be forced with this function.
  519. .. _class_Control_set_global_position:
  520. - void **set_global_position** **(** :ref:`Vector2<class_vector2>` pos **)**
  521. Move the Control to a new position, relative to the top-left corner of the *window* Control, and without changing current anchor mode. (see :ref:`set_margin<class_Control_set_margin>`).
  522. .. _class_Control_set_h_grow_direction:
  523. - void **set_h_grow_direction** **(** :ref:`int<class_int>` direction **)**
  524. .. _class_Control_set_h_size_flags:
  525. - void **set_h_size_flags** **(** :ref:`int<class_int>` flags **)**
  526. Hint for containers, set horizontal positioning flags.
  527. .. _class_Control_set_margin:
  528. - void **set_margin** **(** :ref:`int<class_int>` margin, :ref:`float<class_float>` offset **)**
  529. Set a margin offset. Margin can be one of (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). Offset value being set depends on the anchor mode.
  530. .. _class_Control_set_mouse_filter:
  531. - void **set_mouse_filter** **(** :ref:`int<class_int>` filter **)**
  532. Set when the control is ignoring mouse events (even touchpad events send mouse events). (see the MOUSE_FILTER\_\* constants)
  533. .. _class_Control_set_pivot_offset:
  534. - void **set_pivot_offset** **(** :ref:`Vector2<class_vector2>` pivot_offset **)**
  535. .. _class_Control_set_position:
  536. - void **set_position** **(** :ref:`Vector2<class_vector2>` pos **)**
  537. Move the Control to a new position, relative to the top-left corner of the parent Control, changing all margins if needed and without changing current anchor mode. This is a helper (see :ref:`set_margin<class_Control_set_margin>`).
  538. .. _class_Control_set_rotation:
  539. - void **set_rotation** **(** :ref:`float<class_float>` radians **)**
  540. Set the rotation (in radians).
  541. .. _class_Control_set_rotation_deg:
  542. - void **set_rotation_deg** **(** :ref:`float<class_float>` degrees **)**
  543. Set the rotation (in degrees).
  544. .. _class_Control_set_scale:
  545. - void **set_scale** **(** :ref:`Vector2<class_vector2>` scale **)**
  546. .. _class_Control_set_size:
  547. - void **set_size** **(** :ref:`Vector2<class_vector2>` size **)**
  548. Changes MARGIN_RIGHT and MARGIN_BOTTOM to fit a given size. This is a helper (see :ref:`set_margin<class_Control_set_margin>`).
  549. .. _class_Control_set_stretch_ratio:
  550. - void **set_stretch_ratio** **(** :ref:`float<class_float>` ratio **)**
  551. Hint for containers, set the stretch ratio. This value is relative to other stretch ratio, so if this control has 2 and another has 1, this one will be twice as big.
  552. .. _class_Control_set_theme:
  553. - void **set_theme** **(** :ref:`Theme<class_theme>` theme **)**
  554. Override whole the :ref:`Theme<class_theme>` for this Control and all its children controls.
  555. .. _class_Control_set_tooltip:
  556. - void **set_tooltip** **(** :ref:`String<class_string>` tooltip **)**
  557. Set a tooltip, which will appear when the cursor is resting over this control.
  558. .. _class_Control_set_v_grow_direction:
  559. - void **set_v_grow_direction** **(** :ref:`int<class_int>` direction **)**
  560. .. _class_Control_set_v_size_flags:
  561. - void **set_v_size_flags** **(** :ref:`int<class_int>` flags **)**
  562. Hint for containers, set vertical positioning flags.
  563. .. _class_Control_show_modal:
  564. - void **show_modal** **(** :ref:`bool<class_bool>` exclusive=false **)**
  565. Display a Control as modal. Control must be a subwindow. Modal controls capture the input signals until closed or the area outside them is accessed. When a modal control loses focus, or the ESC key is pressed, they automatically hide. Modal controls are used extensively for popup dialogs and menus.
  566. .. _class_Control_warp_mouse:
  567. - void **warp_mouse** **(** :ref:`Vector2<class_vector2>` to_pos **)**