class_control.rst 77 KB

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