class_control.rst 236 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Control.xml.
  6. .. _class_Control:
  7. Control
  8. =======
  9. **Inherits:** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`BaseButton<class_BaseButton>`, :ref:`ColorRect<class_ColorRect>`, :ref:`Container<class_Container>`, :ref:`GraphEdit<class_GraphEdit>`, :ref:`ItemList<class_ItemList>`, :ref:`Label<class_Label>`, :ref:`LineEdit<class_LineEdit>`, :ref:`MenuBar<class_MenuBar>`, :ref:`NinePatchRect<class_NinePatchRect>`, :ref:`Panel<class_Panel>`, :ref:`Range<class_Range>`, :ref:`ReferenceRect<class_ReferenceRect>`, :ref:`RichTextLabel<class_RichTextLabel>`, :ref:`Separator<class_Separator>`, :ref:`TabBar<class_TabBar>`, :ref:`TextEdit<class_TextEdit>`, :ref:`TextureRect<class_TextureRect>`, :ref:`Tree<class_Tree>`, :ref:`VideoStreamPlayer<class_VideoStreamPlayer>`
  11. Base class for all GUI controls. Adapts its position and size based on its parent control.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Base class for all UI-related nodes. **Control** features a bounding rectangle that defines its extents, an anchor position relative to its parent control or the current viewport, and offsets relative to the anchor. The offsets update automatically when the node, any of its parents, or the screen size change.
  16. For more information on Godot's UI system, anchors, offsets, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from **Control** and :ref:`Container<class_Container>` nodes.
  17. \ **Note:** Since both :ref:`Node2D<class_Node2D>` and **Control** inherit from :ref:`CanvasItem<class_CanvasItem>`, they share several concepts from the class such as the :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` and :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` properties.
  18. \ **User Interface nodes and input**\
  19. Godot propagates input events via viewports. Each :ref:`Viewport<class_Viewport>` is responsible for propagating :ref:`InputEvent<class_InputEvent>`\ s to their child nodes. As the :ref:`SceneTree.root<class_SceneTree_property_root>` is a :ref:`Window<class_Window>`, this already happens automatically for all UI elements in your game.
  20. Input events are propagated through the :ref:`SceneTree<class_SceneTree>` from the root node to all child nodes by calling :ref:`Node._input()<class_Node_private_method__input>`. For UI elements specifically, it makes more sense to override the virtual method :ref:`_gui_input()<class_Control_private_method__gui_input>`, which filters out unrelated input events, such as by checking z-order, :ref:`mouse_filter<class_Control_property_mouse_filter>`, focus, or if the event was inside of the control's bounding box.
  21. Call :ref:`accept_event()<class_Control_method_accept_event>` so no other node receives the event. Once you accept an input, it becomes handled so :ref:`Node._unhandled_input()<class_Node_private_method__unhandled_input>` will not process it.
  22. Only one **Control** node can be in focus. Only the node in focus will receive events. To get the focus, call :ref:`grab_focus()<class_Control_method_grab_focus>`. **Control** nodes lose focus when another node grabs it, or if you hide the node in focus.
  23. Sets :ref:`mouse_filter<class_Control_property_mouse_filter>` to :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>` to tell a **Control** node to ignore mouse or touch events. You'll need it if you place an icon on top of a button.
  24. \ :ref:`Theme<class_Theme>` resources change the control's appearance. The :ref:`theme<class_Control_property_theme>` of a **Control** node affects all of its direct and indirect children (as long as a chain of controls is uninterrupted). To override some of the theme items, call one of the ``add_theme_*_override`` methods, like :ref:`add_theme_font_override()<class_Control_method_add_theme_font_override>`. You can also override theme items in the Inspector.
  25. \ **Note:** Theme items are *not* :ref:`Object<class_Object>` properties. This means you can't access their values using :ref:`Object.get()<class_Object_method_get>` and :ref:`Object.set()<class_Object_method_set>`. Instead, use the ``get_theme_*`` and ``add_theme_*_override`` methods provided by this class.
  26. .. rst-class:: classref-introduction-group
  27. Tutorials
  28. ---------
  29. - :doc:`GUI documentation index <../tutorials/ui/index>`
  30. - :doc:`Custom drawing in 2D <../tutorials/2d/custom_drawing_in_2d>`
  31. - :doc:`Control node gallery <../tutorials/ui/control_node_gallery>`
  32. - :doc:`Multiple resolutions <../tutorials/rendering/multiple_resolutions>`
  33. - `All GUI Demos <https://github.com/godotengine/godot-demo-projects/tree/master/gui>`__
  34. .. rst-class:: classref-reftable-group
  35. Properties
  36. ----------
  37. .. table::
  38. :widths: auto
  39. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  40. | :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] | :ref:`accessibility_controls_nodes<class_Control_property_accessibility_controls_nodes>` | ``[]`` |
  41. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  42. | :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] | :ref:`accessibility_described_by_nodes<class_Control_property_accessibility_described_by_nodes>` | ``[]`` |
  43. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  44. | :ref:`String<class_String>` | :ref:`accessibility_description<class_Control_property_accessibility_description>` | ``""`` |
  45. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  46. | :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] | :ref:`accessibility_flow_to_nodes<class_Control_property_accessibility_flow_to_nodes>` | ``[]`` |
  47. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  48. | :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] | :ref:`accessibility_labeled_by_nodes<class_Control_property_accessibility_labeled_by_nodes>` | ``[]`` |
  49. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  50. | :ref:`AccessibilityLiveMode<enum_DisplayServer_AccessibilityLiveMode>` | :ref:`accessibility_live<class_Control_property_accessibility_live>` | ``0`` |
  51. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  52. | :ref:`String<class_String>` | :ref:`accessibility_name<class_Control_property_accessibility_name>` | ``""`` |
  53. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  54. | :ref:`float<class_float>` | :ref:`anchor_bottom<class_Control_property_anchor_bottom>` | ``0.0`` |
  55. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  56. | :ref:`float<class_float>` | :ref:`anchor_left<class_Control_property_anchor_left>` | ``0.0`` |
  57. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  58. | :ref:`float<class_float>` | :ref:`anchor_right<class_Control_property_anchor_right>` | ``0.0`` |
  59. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  60. | :ref:`float<class_float>` | :ref:`anchor_top<class_Control_property_anchor_top>` | ``0.0`` |
  61. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`auto_translate<class_Control_property_auto_translate>` | |
  63. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`clip_contents<class_Control_property_clip_contents>` | ``false`` |
  65. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  66. | :ref:`Vector2<class_Vector2>` | :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>` | ``Vector2(0, 0)`` |
  67. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  68. | :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` | :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>` | ``0`` |
  69. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  70. | :ref:`FocusMode<enum_Control_FocusMode>` | :ref:`focus_mode<class_Control_property_focus_mode>` | ``0`` |
  71. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  72. | :ref:`NodePath<class_NodePath>` | :ref:`focus_neighbor_bottom<class_Control_property_focus_neighbor_bottom>` | ``NodePath("")`` |
  73. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  74. | :ref:`NodePath<class_NodePath>` | :ref:`focus_neighbor_left<class_Control_property_focus_neighbor_left>` | ``NodePath("")`` |
  75. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  76. | :ref:`NodePath<class_NodePath>` | :ref:`focus_neighbor_right<class_Control_property_focus_neighbor_right>` | ``NodePath("")`` |
  77. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  78. | :ref:`NodePath<class_NodePath>` | :ref:`focus_neighbor_top<class_Control_property_focus_neighbor_top>` | ``NodePath("")`` |
  79. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  80. | :ref:`NodePath<class_NodePath>` | :ref:`focus_next<class_Control_property_focus_next>` | ``NodePath("")`` |
  81. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  82. | :ref:`NodePath<class_NodePath>` | :ref:`focus_previous<class_Control_property_focus_previous>` | ``NodePath("")`` |
  83. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  84. | :ref:`Vector2<class_Vector2>` | :ref:`global_position<class_Control_property_global_position>` | |
  85. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  86. | :ref:`GrowDirection<enum_Control_GrowDirection>` | :ref:`grow_horizontal<class_Control_property_grow_horizontal>` | ``1`` |
  87. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  88. | :ref:`GrowDirection<enum_Control_GrowDirection>` | :ref:`grow_vertical<class_Control_property_grow_vertical>` | ``1`` |
  89. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  90. | :ref:`LayoutDirection<enum_Control_LayoutDirection>` | :ref:`layout_direction<class_Control_property_layout_direction>` | ``0`` |
  91. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  92. | :ref:`bool<class_bool>` | :ref:`localize_numeral_system<class_Control_property_localize_numeral_system>` | ``true`` |
  93. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  94. | :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` | :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>` | ``0`` |
  95. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  96. | :ref:`CursorShape<enum_Control_CursorShape>` | :ref:`mouse_default_cursor_shape<class_Control_property_mouse_default_cursor_shape>` | ``0`` |
  97. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  98. | :ref:`MouseFilter<enum_Control_MouseFilter>` | :ref:`mouse_filter<class_Control_property_mouse_filter>` | ``0`` |
  99. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  100. | :ref:`bool<class_bool>` | :ref:`mouse_force_pass_scroll_events<class_Control_property_mouse_force_pass_scroll_events>` | ``true`` |
  101. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  102. | :ref:`float<class_float>` | :ref:`offset_bottom<class_Control_property_offset_bottom>` | ``0.0`` |
  103. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  104. | :ref:`float<class_float>` | :ref:`offset_left<class_Control_property_offset_left>` | ``0.0`` |
  105. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  106. | :ref:`float<class_float>` | :ref:`offset_right<class_Control_property_offset_right>` | ``0.0`` |
  107. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  108. | :ref:`float<class_float>` | :ref:`offset_top<class_Control_property_offset_top>` | ``0.0`` |
  109. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  110. | :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` | physics_interpolation_mode | ``2`` (overrides :ref:`Node<class_Node_property_physics_interpolation_mode>`) |
  111. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  112. | :ref:`Vector2<class_Vector2>` | :ref:`pivot_offset<class_Control_property_pivot_offset>` | ``Vector2(0, 0)`` |
  113. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  114. | :ref:`Vector2<class_Vector2>` | :ref:`position<class_Control_property_position>` | ``Vector2(0, 0)`` |
  115. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  116. | :ref:`float<class_float>` | :ref:`rotation<class_Control_property_rotation>` | ``0.0`` |
  117. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  118. | :ref:`float<class_float>` | :ref:`rotation_degrees<class_Control_property_rotation_degrees>` | |
  119. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  120. | :ref:`Vector2<class_Vector2>` | :ref:`scale<class_Control_property_scale>` | ``Vector2(1, 1)`` |
  121. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  122. | :ref:`Node<class_Node>` | :ref:`shortcut_context<class_Control_property_shortcut_context>` | |
  123. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  124. | :ref:`Vector2<class_Vector2>` | :ref:`size<class_Control_property_size>` | ``Vector2(0, 0)`` |
  125. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  126. | |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] | :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` | ``1`` |
  127. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  128. | :ref:`float<class_float>` | :ref:`size_flags_stretch_ratio<class_Control_property_size_flags_stretch_ratio>` | ``1.0`` |
  129. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  130. | |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] | :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>` | ``1`` |
  131. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  132. | :ref:`Theme<class_Theme>` | :ref:`theme<class_Control_property_theme>` | |
  133. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  134. | :ref:`StringName<class_StringName>` | :ref:`theme_type_variation<class_Control_property_theme_type_variation>` | ``&""`` |
  135. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  136. | :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` | :ref:`tooltip_auto_translate_mode<class_Control_property_tooltip_auto_translate_mode>` | ``0`` |
  137. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  138. | :ref:`String<class_String>` | :ref:`tooltip_text<class_Control_property_tooltip_text>` | ``""`` |
  139. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  140. .. rst-class:: classref-reftable-group
  141. Methods
  142. -------
  143. .. table::
  144. :widths: auto
  145. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | :ref:`String<class_String>` | :ref:`_accessibility_get_contextual_info<class_Control_private_method__accessibility_get_contextual_info>`\ (\ ) |virtual| |const| |
  147. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`bool<class_bool>` | :ref:`_can_drop_data<class_Control_private_method__can_drop_data>`\ (\ at_position\: :ref:`Vector2<class_Vector2>`, data\: :ref:`Variant<class_Variant>`\ ) |virtual| |const| |
  149. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | |void| | :ref:`_drop_data<class_Control_private_method__drop_data>`\ (\ at_position\: :ref:`Vector2<class_Vector2>`, data\: :ref:`Variant<class_Variant>`\ ) |virtual| |
  151. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | :ref:`String<class_String>` | :ref:`_get_accessibility_container_name<class_Control_private_method__get_accessibility_container_name>`\ (\ node\: :ref:`Node<class_Node>`\ ) |virtual| |const| |
  153. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`Variant<class_Variant>` | :ref:`_get_drag_data<class_Control_private_method__get_drag_data>`\ (\ at_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |
  155. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`Vector2<class_Vector2>` | :ref:`_get_minimum_size<class_Control_private_method__get_minimum_size>`\ (\ ) |virtual| |const| |
  157. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`String<class_String>` | :ref:`_get_tooltip<class_Control_private_method__get_tooltip>`\ (\ at_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |const| |
  159. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | |void| | :ref:`_gui_input<class_Control_private_method__gui_input>`\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual| |
  161. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`_has_point<class_Control_private_method__has_point>`\ (\ point\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |const| |
  163. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`Object<class_Object>` | :ref:`_make_custom_tooltip<class_Control_private_method__make_custom_tooltip>`\ (\ for_text\: :ref:`String<class_String>`\ ) |virtual| |const| |
  165. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`Array<class_Array>`\[:ref:`Vector3i<class_Vector3i>`\] | :ref:`_structured_text_parser<class_Control_private_method__structured_text_parser>`\ (\ args\: :ref:`Array<class_Array>`, text\: :ref:`String<class_String>`\ ) |virtual| |const| |
  167. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | |void| | :ref:`accept_event<class_Control_method_accept_event>`\ (\ ) |
  169. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | |void| | :ref:`accessibility_drag<class_Control_method_accessibility_drag>`\ (\ ) |
  171. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | |void| | :ref:`accessibility_drop<class_Control_method_accessibility_drop>`\ (\ ) |
  173. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | |void| | :ref:`add_theme_color_override<class_Control_method_add_theme_color_override>`\ (\ name\: :ref:`StringName<class_StringName>`, color\: :ref:`Color<class_Color>`\ ) |
  175. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | |void| | :ref:`add_theme_constant_override<class_Control_method_add_theme_constant_override>`\ (\ name\: :ref:`StringName<class_StringName>`, constant\: :ref:`int<class_int>`\ ) |
  177. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | |void| | :ref:`add_theme_font_override<class_Control_method_add_theme_font_override>`\ (\ name\: :ref:`StringName<class_StringName>`, font\: :ref:`Font<class_Font>`\ ) |
  179. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | |void| | :ref:`add_theme_font_size_override<class_Control_method_add_theme_font_size_override>`\ (\ name\: :ref:`StringName<class_StringName>`, font_size\: :ref:`int<class_int>`\ ) |
  181. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | |void| | :ref:`add_theme_icon_override<class_Control_method_add_theme_icon_override>`\ (\ name\: :ref:`StringName<class_StringName>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) |
  183. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | |void| | :ref:`add_theme_stylebox_override<class_Control_method_add_theme_stylebox_override>`\ (\ name\: :ref:`StringName<class_StringName>`, stylebox\: :ref:`StyleBox<class_StyleBox>`\ ) |
  185. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | |void| | :ref:`begin_bulk_theme_override<class_Control_method_begin_bulk_theme_override>`\ (\ ) |
  187. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | |void| | :ref:`end_bulk_theme_override<class_Control_method_end_bulk_theme_override>`\ (\ ) |
  189. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | :ref:`Control<class_Control>` | :ref:`find_next_valid_focus<class_Control_method_find_next_valid_focus>`\ (\ ) |const| |
  191. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`Control<class_Control>` | :ref:`find_prev_valid_focus<class_Control_method_find_prev_valid_focus>`\ (\ ) |const| |
  193. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | :ref:`Control<class_Control>` | :ref:`find_valid_focus_neighbor<class_Control_method_find_valid_focus_neighbor>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
  195. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | |void| | :ref:`force_drag<class_Control_method_force_drag>`\ (\ data\: :ref:`Variant<class_Variant>`, preview\: :ref:`Control<class_Control>`\ ) |
  197. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | :ref:`float<class_float>` | :ref:`get_anchor<class_Control_method_get_anchor>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
  199. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`Vector2<class_Vector2>` | :ref:`get_begin<class_Control_method_get_begin>`\ (\ ) |const| |
  201. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | :ref:`Vector2<class_Vector2>` | :ref:`get_combined_minimum_size<class_Control_method_get_combined_minimum_size>`\ (\ ) |const| |
  203. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | :ref:`CursorShape<enum_Control_CursorShape>` | :ref:`get_cursor_shape<class_Control_method_get_cursor_shape>`\ (\ position\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) |const| |
  205. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | :ref:`Vector2<class_Vector2>` | :ref:`get_end<class_Control_method_get_end>`\ (\ ) |const| |
  207. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | :ref:`FocusMode<enum_Control_FocusMode>` | :ref:`get_focus_mode_with_override<class_Control_method_get_focus_mode_with_override>`\ (\ ) |const| |
  209. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | :ref:`NodePath<class_NodePath>` | :ref:`get_focus_neighbor<class_Control_method_get_focus_neighbor>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
  211. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | :ref:`Rect2<class_Rect2>` | :ref:`get_global_rect<class_Control_method_get_global_rect>`\ (\ ) |const| |
  213. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | :ref:`Vector2<class_Vector2>` | :ref:`get_minimum_size<class_Control_method_get_minimum_size>`\ (\ ) |const| |
  215. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | :ref:`MouseFilter<enum_Control_MouseFilter>` | :ref:`get_mouse_filter_with_override<class_Control_method_get_mouse_filter_with_override>`\ (\ ) |const| |
  217. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | :ref:`float<class_float>` | :ref:`get_offset<class_Control_method_get_offset>`\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
  219. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | :ref:`Vector2<class_Vector2>` | :ref:`get_parent_area_size<class_Control_method_get_parent_area_size>`\ (\ ) |const| |
  221. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | :ref:`Control<class_Control>` | :ref:`get_parent_control<class_Control_method_get_parent_control>`\ (\ ) |const| |
  223. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | :ref:`Rect2<class_Rect2>` | :ref:`get_rect<class_Control_method_get_rect>`\ (\ ) |const| |
  225. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | :ref:`Vector2<class_Vector2>` | :ref:`get_screen_position<class_Control_method_get_screen_position>`\ (\ ) |const| |
  227. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | :ref:`Color<class_Color>` | :ref:`get_theme_color<class_Control_method_get_theme_color>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  229. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | :ref:`int<class_int>` | :ref:`get_theme_constant<class_Control_method_get_theme_constant>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  231. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | :ref:`float<class_float>` | :ref:`get_theme_default_base_scale<class_Control_method_get_theme_default_base_scale>`\ (\ ) |const| |
  233. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | :ref:`Font<class_Font>` | :ref:`get_theme_default_font<class_Control_method_get_theme_default_font>`\ (\ ) |const| |
  235. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | :ref:`int<class_int>` | :ref:`get_theme_default_font_size<class_Control_method_get_theme_default_font_size>`\ (\ ) |const| |
  237. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | :ref:`Font<class_Font>` | :ref:`get_theme_font<class_Control_method_get_theme_font>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  239. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | :ref:`int<class_int>` | :ref:`get_theme_font_size<class_Control_method_get_theme_font_size>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  241. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_theme_icon<class_Control_method_get_theme_icon>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  243. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | :ref:`StyleBox<class_StyleBox>` | :ref:`get_theme_stylebox<class_Control_method_get_theme_stylebox>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  245. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | :ref:`String<class_String>` | :ref:`get_tooltip<class_Control_method_get_tooltip>`\ (\ at_position\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) |const| |
  247. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | |void| | :ref:`grab_click_focus<class_Control_method_grab_click_focus>`\ (\ ) |
  249. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | |void| | :ref:`grab_focus<class_Control_method_grab_focus>`\ (\ ) |
  251. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | :ref:`bool<class_bool>` | :ref:`has_focus<class_Control_method_has_focus>`\ (\ ) |const| |
  253. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | :ref:`bool<class_bool>` | :ref:`has_theme_color<class_Control_method_has_theme_color>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  255. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | :ref:`bool<class_bool>` | :ref:`has_theme_color_override<class_Control_method_has_theme_color_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  257. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. | :ref:`bool<class_bool>` | :ref:`has_theme_constant<class_Control_method_has_theme_constant>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  259. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  260. | :ref:`bool<class_bool>` | :ref:`has_theme_constant_override<class_Control_method_has_theme_constant_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  261. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  262. | :ref:`bool<class_bool>` | :ref:`has_theme_font<class_Control_method_has_theme_font>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  263. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  264. | :ref:`bool<class_bool>` | :ref:`has_theme_font_override<class_Control_method_has_theme_font_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  265. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  266. | :ref:`bool<class_bool>` | :ref:`has_theme_font_size<class_Control_method_has_theme_font_size>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  267. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  268. | :ref:`bool<class_bool>` | :ref:`has_theme_font_size_override<class_Control_method_has_theme_font_size_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  269. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  270. | :ref:`bool<class_bool>` | :ref:`has_theme_icon<class_Control_method_has_theme_icon>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  271. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  272. | :ref:`bool<class_bool>` | :ref:`has_theme_icon_override<class_Control_method_has_theme_icon_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  273. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  274. | :ref:`bool<class_bool>` | :ref:`has_theme_stylebox<class_Control_method_has_theme_stylebox>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  275. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  276. | :ref:`bool<class_bool>` | :ref:`has_theme_stylebox_override<class_Control_method_has_theme_stylebox_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  277. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  278. | :ref:`bool<class_bool>` | :ref:`is_drag_successful<class_Control_method_is_drag_successful>`\ (\ ) |const| |
  279. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  280. | :ref:`bool<class_bool>` | :ref:`is_layout_rtl<class_Control_method_is_layout_rtl>`\ (\ ) |const| |
  281. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  282. | |void| | :ref:`release_focus<class_Control_method_release_focus>`\ (\ ) |
  283. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  284. | |void| | :ref:`remove_theme_color_override<class_Control_method_remove_theme_color_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  285. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  286. | |void| | :ref:`remove_theme_constant_override<class_Control_method_remove_theme_constant_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  287. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  288. | |void| | :ref:`remove_theme_font_override<class_Control_method_remove_theme_font_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  289. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  290. | |void| | :ref:`remove_theme_font_size_override<class_Control_method_remove_theme_font_size_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  291. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  292. | |void| | :ref:`remove_theme_icon_override<class_Control_method_remove_theme_icon_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  293. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  294. | |void| | :ref:`remove_theme_stylebox_override<class_Control_method_remove_theme_stylebox_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  295. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  296. | |void| | :ref:`reset_size<class_Control_method_reset_size>`\ (\ ) |
  297. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  298. | |void| | :ref:`set_anchor<class_Control_method_set_anchor>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, anchor\: :ref:`float<class_float>`, keep_offset\: :ref:`bool<class_bool>` = false, push_opposite_anchor\: :ref:`bool<class_bool>` = true\ ) |
  299. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  300. | |void| | :ref:`set_anchor_and_offset<class_Control_method_set_anchor_and_offset>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, anchor\: :ref:`float<class_float>`, offset\: :ref:`float<class_float>`, push_opposite_anchor\: :ref:`bool<class_bool>` = false\ ) |
  301. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  302. | |void| | :ref:`set_anchors_and_offsets_preset<class_Control_method_set_anchors_and_offsets_preset>`\ (\ preset\: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, resize_mode\: :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` = 0, margin\: :ref:`int<class_int>` = 0\ ) |
  303. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  304. | |void| | :ref:`set_anchors_preset<class_Control_method_set_anchors_preset>`\ (\ preset\: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) |
  305. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  306. | |void| | :ref:`set_begin<class_Control_method_set_begin>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |
  307. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  308. | |void| | :ref:`set_drag_forwarding<class_Control_method_set_drag_forwarding>`\ (\ drag_func\: :ref:`Callable<class_Callable>`, can_drop_func\: :ref:`Callable<class_Callable>`, drop_func\: :ref:`Callable<class_Callable>`\ ) |
  309. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  310. | |void| | :ref:`set_drag_preview<class_Control_method_set_drag_preview>`\ (\ control\: :ref:`Control<class_Control>`\ ) |
  311. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  312. | |void| | :ref:`set_end<class_Control_method_set_end>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |
  313. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  314. | |void| | :ref:`set_focus_neighbor<class_Control_method_set_focus_neighbor>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ ) |
  315. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  316. | |void| | :ref:`set_global_position<class_Control_method_set_global_position>`\ (\ position\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) |
  317. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  318. | |void| | :ref:`set_offset<class_Control_method_set_offset>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ ) |
  319. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  320. | |void| | :ref:`set_offsets_preset<class_Control_method_set_offsets_preset>`\ (\ preset\: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, resize_mode\: :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` = 0, margin\: :ref:`int<class_int>` = 0\ ) |
  321. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  322. | |void| | :ref:`set_position<class_Control_method_set_position>`\ (\ position\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) |
  323. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  324. | |void| | :ref:`set_size<class_Control_method_set_size>`\ (\ size\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) |
  325. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  326. | |void| | :ref:`update_minimum_size<class_Control_method_update_minimum_size>`\ (\ ) |
  327. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  328. | |void| | :ref:`warp_mouse<class_Control_method_warp_mouse>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |
  329. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  330. .. rst-class:: classref-section-separator
  331. ----
  332. .. rst-class:: classref-descriptions-group
  333. Signals
  334. -------
  335. .. _class_Control_signal_focus_entered:
  336. .. rst-class:: classref-signal
  337. **focus_entered**\ (\ ) :ref:`๐Ÿ”—<class_Control_signal_focus_entered>`
  338. Emitted when the node gains focus.
  339. .. rst-class:: classref-item-separator
  340. ----
  341. .. _class_Control_signal_focus_exited:
  342. .. rst-class:: classref-signal
  343. **focus_exited**\ (\ ) :ref:`๐Ÿ”—<class_Control_signal_focus_exited>`
  344. Emitted when the node loses focus.
  345. .. rst-class:: classref-item-separator
  346. ----
  347. .. _class_Control_signal_gui_input:
  348. .. rst-class:: classref-signal
  349. **gui_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) :ref:`๐Ÿ”—<class_Control_signal_gui_input>`
  350. Emitted when the node receives an :ref:`InputEvent<class_InputEvent>`.
  351. .. rst-class:: classref-item-separator
  352. ----
  353. .. _class_Control_signal_minimum_size_changed:
  354. .. rst-class:: classref-signal
  355. **minimum_size_changed**\ (\ ) :ref:`๐Ÿ”—<class_Control_signal_minimum_size_changed>`
  356. Emitted when the node's minimum size changes.
  357. .. rst-class:: classref-item-separator
  358. ----
  359. .. _class_Control_signal_mouse_entered:
  360. .. rst-class:: classref-signal
  361. **mouse_entered**\ (\ ) :ref:`๐Ÿ”—<class_Control_signal_mouse_entered>`
  362. Emitted when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.
  363. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect, which Control receives the signal.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_Control_signal_mouse_exited:
  367. .. rst-class:: classref-signal
  368. **mouse_exited**\ (\ ) :ref:`๐Ÿ”—<class_Control_signal_mouse_exited>`
  369. Emitted when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.
  370. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect, which Control receives the signal.
  371. \ **Note:** If you want to check whether the mouse truly left the area, ignoring any top nodes, you can use code like this:
  372. ::
  373. func _on_mouse_exited():
  374. if not Rect2(Vector2(), size).has_point(get_local_mouse_position()):
  375. # Not hovering over area.
  376. .. rst-class:: classref-item-separator
  377. ----
  378. .. _class_Control_signal_resized:
  379. .. rst-class:: classref-signal
  380. **resized**\ (\ ) :ref:`๐Ÿ”—<class_Control_signal_resized>`
  381. Emitted when the control changes size.
  382. .. rst-class:: classref-item-separator
  383. ----
  384. .. _class_Control_signal_size_flags_changed:
  385. .. rst-class:: classref-signal
  386. **size_flags_changed**\ (\ ) :ref:`๐Ÿ”—<class_Control_signal_size_flags_changed>`
  387. Emitted when one of the size flags changes. See :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.
  388. .. rst-class:: classref-item-separator
  389. ----
  390. .. _class_Control_signal_theme_changed:
  391. .. rst-class:: classref-signal
  392. **theme_changed**\ (\ ) :ref:`๐Ÿ”—<class_Control_signal_theme_changed>`
  393. Emitted when the :ref:`NOTIFICATION_THEME_CHANGED<class_Control_constant_NOTIFICATION_THEME_CHANGED>` notification is sent.
  394. .. rst-class:: classref-section-separator
  395. ----
  396. .. rst-class:: classref-descriptions-group
  397. Enumerations
  398. ------------
  399. .. _enum_Control_FocusMode:
  400. .. rst-class:: classref-enumeration
  401. enum **FocusMode**: :ref:`๐Ÿ”—<enum_Control_FocusMode>`
  402. .. _class_Control_constant_FOCUS_NONE:
  403. .. rst-class:: classref-enumeration-constant
  404. :ref:`FocusMode<enum_Control_FocusMode>` **FOCUS_NONE** = ``0``
  405. The node cannot grab focus. Use with :ref:`focus_mode<class_Control_property_focus_mode>`.
  406. .. _class_Control_constant_FOCUS_CLICK:
  407. .. rst-class:: classref-enumeration-constant
  408. :ref:`FocusMode<enum_Control_FocusMode>` **FOCUS_CLICK** = ``1``
  409. The node can only grab focus on mouse clicks. Use with :ref:`focus_mode<class_Control_property_focus_mode>`.
  410. .. _class_Control_constant_FOCUS_ALL:
  411. .. rst-class:: classref-enumeration-constant
  412. :ref:`FocusMode<enum_Control_FocusMode>` **FOCUS_ALL** = ``2``
  413. The node can grab focus on mouse click, using the arrows and the Tab keys on the keyboard, or using the D-pad buttons on a gamepad. Use with :ref:`focus_mode<class_Control_property_focus_mode>`.
  414. .. _class_Control_constant_FOCUS_ACCESSIBILITY:
  415. .. rst-class:: classref-enumeration-constant
  416. :ref:`FocusMode<enum_Control_FocusMode>` **FOCUS_ACCESSIBILITY** = ``3``
  417. The node can grab focus only when screen reader is active. Use with :ref:`focus_mode<class_Control_property_focus_mode>`.
  418. .. rst-class:: classref-item-separator
  419. ----
  420. .. _enum_Control_FocusBehaviorRecursive:
  421. .. rst-class:: classref-enumeration
  422. enum **FocusBehaviorRecursive**: :ref:`๐Ÿ”—<enum_Control_FocusBehaviorRecursive>`
  423. .. _class_Control_constant_FOCUS_BEHAVIOR_INHERITED:
  424. .. rst-class:: classref-enumeration-constant
  425. :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` **FOCUS_BEHAVIOR_INHERITED** = ``0``
  426. Inherits the :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>` from the parent control. If there is no parent control, this is the same as :ref:`FOCUS_BEHAVIOR_ENABLED<class_Control_constant_FOCUS_BEHAVIOR_ENABLED>`.
  427. .. _class_Control_constant_FOCUS_BEHAVIOR_DISABLED:
  428. .. rst-class:: classref-enumeration-constant
  429. :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` **FOCUS_BEHAVIOR_DISABLED** = ``1``
  430. Prevents the control from getting focused. :ref:`get_focus_mode_with_override()<class_Control_method_get_focus_mode_with_override>` will return :ref:`FOCUS_NONE<class_Control_constant_FOCUS_NONE>`.
  431. .. _class_Control_constant_FOCUS_BEHAVIOR_ENABLED:
  432. .. rst-class:: classref-enumeration-constant
  433. :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` **FOCUS_BEHAVIOR_ENABLED** = ``2``
  434. Allows the control to be focused, depending on the :ref:`focus_mode<class_Control_property_focus_mode>`. This can be used to ignore the parent's :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>`. :ref:`get_focus_mode_with_override()<class_Control_method_get_focus_mode_with_override>` will return the :ref:`focus_mode<class_Control_property_focus_mode>`.
  435. .. rst-class:: classref-item-separator
  436. ----
  437. .. _enum_Control_MouseBehaviorRecursive:
  438. .. rst-class:: classref-enumeration
  439. enum **MouseBehaviorRecursive**: :ref:`๐Ÿ”—<enum_Control_MouseBehaviorRecursive>`
  440. .. _class_Control_constant_MOUSE_BEHAVIOR_INHERITED:
  441. .. rst-class:: classref-enumeration-constant
  442. :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` **MOUSE_BEHAVIOR_INHERITED** = ``0``
  443. Inherits the :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>` from the parent control. If there is no parent control, this is the same as :ref:`MOUSE_BEHAVIOR_ENABLED<class_Control_constant_MOUSE_BEHAVIOR_ENABLED>`.
  444. .. _class_Control_constant_MOUSE_BEHAVIOR_DISABLED:
  445. .. rst-class:: classref-enumeration-constant
  446. :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` **MOUSE_BEHAVIOR_DISABLED** = ``1``
  447. Prevents the control from receiving mouse input. :ref:`get_mouse_filter_with_override()<class_Control_method_get_mouse_filter_with_override>` will return :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>`.
  448. .. _class_Control_constant_MOUSE_BEHAVIOR_ENABLED:
  449. .. rst-class:: classref-enumeration-constant
  450. :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` **MOUSE_BEHAVIOR_ENABLED** = ``2``
  451. Allows the control to be receive mouse input, depending on the :ref:`mouse_filter<class_Control_property_mouse_filter>`. This can be used to ignore the parent's :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>`. :ref:`get_mouse_filter_with_override()<class_Control_method_get_mouse_filter_with_override>` will return the :ref:`mouse_filter<class_Control_property_mouse_filter>`.
  452. .. rst-class:: classref-item-separator
  453. ----
  454. .. _enum_Control_CursorShape:
  455. .. rst-class:: classref-enumeration
  456. enum **CursorShape**: :ref:`๐Ÿ”—<enum_Control_CursorShape>`
  457. .. _class_Control_constant_CURSOR_ARROW:
  458. .. rst-class:: classref-enumeration-constant
  459. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_ARROW** = ``0``
  460. Show the system's arrow mouse cursor when the user hovers the node. Use with :ref:`mouse_default_cursor_shape<class_Control_property_mouse_default_cursor_shape>`.
  461. .. _class_Control_constant_CURSOR_IBEAM:
  462. .. rst-class:: classref-enumeration-constant
  463. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_IBEAM** = ``1``
  464. Show the system's I-beam mouse cursor when the user hovers the node. The I-beam pointer has a shape similar to "I". It tells the user they can highlight or insert text.
  465. .. _class_Control_constant_CURSOR_POINTING_HAND:
  466. .. rst-class:: classref-enumeration-constant
  467. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_POINTING_HAND** = ``2``
  468. Show the system's pointing hand mouse cursor when the user hovers the node.
  469. .. _class_Control_constant_CURSOR_CROSS:
  470. .. rst-class:: classref-enumeration-constant
  471. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_CROSS** = ``3``
  472. Show the system's cross mouse cursor when the user hovers the node.
  473. .. _class_Control_constant_CURSOR_WAIT:
  474. .. rst-class:: classref-enumeration-constant
  475. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_WAIT** = ``4``
  476. Show the system's wait mouse cursor when the user hovers the node. Often an hourglass.
  477. .. _class_Control_constant_CURSOR_BUSY:
  478. .. rst-class:: classref-enumeration-constant
  479. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_BUSY** = ``5``
  480. Show the system's busy mouse cursor when the user hovers the node. Often an arrow with a small hourglass.
  481. .. _class_Control_constant_CURSOR_DRAG:
  482. .. rst-class:: classref-enumeration-constant
  483. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_DRAG** = ``6``
  484. Show the system's drag mouse cursor, often a closed fist or a cross symbol, when the user hovers the node. It tells the user they're currently dragging an item, like a node in the Scene dock.
  485. .. _class_Control_constant_CURSOR_CAN_DROP:
  486. .. rst-class:: classref-enumeration-constant
  487. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_CAN_DROP** = ``7``
  488. Show the system's drop mouse cursor when the user hovers the node. It can be an open hand. It tells the user they can drop an item they're currently grabbing, like a node in the Scene dock.
  489. .. _class_Control_constant_CURSOR_FORBIDDEN:
  490. .. rst-class:: classref-enumeration-constant
  491. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_FORBIDDEN** = ``8``
  492. Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle.
  493. .. _class_Control_constant_CURSOR_VSIZE:
  494. .. rst-class:: classref-enumeration-constant
  495. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_VSIZE** = ``9``
  496. Show the system's vertical resize mouse cursor when the user hovers the node. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically.
  497. .. _class_Control_constant_CURSOR_HSIZE:
  498. .. rst-class:: classref-enumeration-constant
  499. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_HSIZE** = ``10``
  500. Show the system's horizontal resize mouse cursor when the user hovers the node. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally.
  501. .. _class_Control_constant_CURSOR_BDIAGSIZE:
  502. .. rst-class:: classref-enumeration-constant
  503. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_BDIAGSIZE** = ``11``
  504. Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically.
  505. .. _class_Control_constant_CURSOR_FDIAGSIZE:
  506. .. rst-class:: classref-enumeration-constant
  507. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_FDIAGSIZE** = ``12``
  508. Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of :ref:`CURSOR_BDIAGSIZE<class_Control_constant_CURSOR_BDIAGSIZE>`. It tells the user they can resize the window or the panel both horizontally and vertically.
  509. .. _class_Control_constant_CURSOR_MOVE:
  510. .. rst-class:: classref-enumeration-constant
  511. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_MOVE** = ``13``
  512. Show the system's move mouse cursor when the user hovers the node. It shows 2 double-headed arrows at a 90 degree angle. It tells the user they can move a UI element freely.
  513. .. _class_Control_constant_CURSOR_VSPLIT:
  514. .. rst-class:: classref-enumeration-constant
  515. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_VSPLIT** = ``14``
  516. Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as :ref:`CURSOR_VSIZE<class_Control_constant_CURSOR_VSIZE>`.
  517. .. _class_Control_constant_CURSOR_HSPLIT:
  518. .. rst-class:: classref-enumeration-constant
  519. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_HSPLIT** = ``15``
  520. Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as :ref:`CURSOR_HSIZE<class_Control_constant_CURSOR_HSIZE>`.
  521. .. _class_Control_constant_CURSOR_HELP:
  522. .. rst-class:: classref-enumeration-constant
  523. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_HELP** = ``16``
  524. Show the system's help mouse cursor when the user hovers the node, a question mark.
  525. .. rst-class:: classref-item-separator
  526. ----
  527. .. _enum_Control_LayoutPreset:
  528. .. rst-class:: classref-enumeration
  529. enum **LayoutPreset**: :ref:`๐Ÿ”—<enum_Control_LayoutPreset>`
  530. .. _class_Control_constant_PRESET_TOP_LEFT:
  531. .. rst-class:: classref-enumeration-constant
  532. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_TOP_LEFT** = ``0``
  533. Snap all 4 anchors to the top-left of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  534. .. _class_Control_constant_PRESET_TOP_RIGHT:
  535. .. rst-class:: classref-enumeration-constant
  536. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_TOP_RIGHT** = ``1``
  537. Snap all 4 anchors to the top-right of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  538. .. _class_Control_constant_PRESET_BOTTOM_LEFT:
  539. .. rst-class:: classref-enumeration-constant
  540. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_BOTTOM_LEFT** = ``2``
  541. Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  542. .. _class_Control_constant_PRESET_BOTTOM_RIGHT:
  543. .. rst-class:: classref-enumeration-constant
  544. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_BOTTOM_RIGHT** = ``3``
  545. Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  546. .. _class_Control_constant_PRESET_CENTER_LEFT:
  547. .. rst-class:: classref-enumeration-constant
  548. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_CENTER_LEFT** = ``4``
  549. Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  550. .. _class_Control_constant_PRESET_CENTER_TOP:
  551. .. rst-class:: classref-enumeration-constant
  552. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_CENTER_TOP** = ``5``
  553. Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  554. .. _class_Control_constant_PRESET_CENTER_RIGHT:
  555. .. rst-class:: classref-enumeration-constant
  556. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_CENTER_RIGHT** = ``6``
  557. Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  558. .. _class_Control_constant_PRESET_CENTER_BOTTOM:
  559. .. rst-class:: classref-enumeration-constant
  560. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_CENTER_BOTTOM** = ``7``
  561. Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  562. .. _class_Control_constant_PRESET_CENTER:
  563. .. rst-class:: classref-enumeration-constant
  564. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_CENTER** = ``8``
  565. Snap all 4 anchors to the center of the parent control's bounds. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  566. .. _class_Control_constant_PRESET_LEFT_WIDE:
  567. .. rst-class:: classref-enumeration-constant
  568. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_LEFT_WIDE** = ``9``
  569. Snap all 4 anchors to the left edge of the parent control. The left offset becomes relative to the left edge and the top offset relative to the top left corner of the node's parent. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  570. .. _class_Control_constant_PRESET_TOP_WIDE:
  571. .. rst-class:: classref-enumeration-constant
  572. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_TOP_WIDE** = ``10``
  573. Snap all 4 anchors to the top edge of the parent control. The left offset becomes relative to the top left corner, the top offset relative to the top edge, and the right offset relative to the top right corner of the node's parent. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  574. .. _class_Control_constant_PRESET_RIGHT_WIDE:
  575. .. rst-class:: classref-enumeration-constant
  576. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_RIGHT_WIDE** = ``11``
  577. Snap all 4 anchors to the right edge of the parent control. The right offset becomes relative to the right edge and the top offset relative to the top right corner of the node's parent. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  578. .. _class_Control_constant_PRESET_BOTTOM_WIDE:
  579. .. rst-class:: classref-enumeration-constant
  580. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_BOTTOM_WIDE** = ``12``
  581. Snap all 4 anchors to the bottom edge of the parent control. The left offset becomes relative to the bottom left corner, the bottom offset relative to the bottom edge, and the right offset relative to the bottom right corner of the node's parent. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  582. .. _class_Control_constant_PRESET_VCENTER_WIDE:
  583. .. rst-class:: classref-enumeration-constant
  584. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_VCENTER_WIDE** = ``13``
  585. Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  586. .. _class_Control_constant_PRESET_HCENTER_WIDE:
  587. .. rst-class:: classref-enumeration-constant
  588. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_HCENTER_WIDE** = ``14``
  589. Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  590. .. _class_Control_constant_PRESET_FULL_RECT:
  591. .. rst-class:: classref-enumeration-constant
  592. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_FULL_RECT** = ``15``
  593. Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the **Control** will fit its parent control. Use with :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  594. .. rst-class:: classref-item-separator
  595. ----
  596. .. _enum_Control_LayoutPresetMode:
  597. .. rst-class:: classref-enumeration
  598. enum **LayoutPresetMode**: :ref:`๐Ÿ”—<enum_Control_LayoutPresetMode>`
  599. .. _class_Control_constant_PRESET_MODE_MINSIZE:
  600. .. rst-class:: classref-enumeration-constant
  601. :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` **PRESET_MODE_MINSIZE** = ``0``
  602. The control will be resized to its minimum size.
  603. .. _class_Control_constant_PRESET_MODE_KEEP_WIDTH:
  604. .. rst-class:: classref-enumeration-constant
  605. :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` **PRESET_MODE_KEEP_WIDTH** = ``1``
  606. The control's width will not change.
  607. .. _class_Control_constant_PRESET_MODE_KEEP_HEIGHT:
  608. .. rst-class:: classref-enumeration-constant
  609. :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` **PRESET_MODE_KEEP_HEIGHT** = ``2``
  610. The control's height will not change.
  611. .. _class_Control_constant_PRESET_MODE_KEEP_SIZE:
  612. .. rst-class:: classref-enumeration-constant
  613. :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` **PRESET_MODE_KEEP_SIZE** = ``3``
  614. The control's size will not change.
  615. .. rst-class:: classref-item-separator
  616. ----
  617. .. _enum_Control_SizeFlags:
  618. .. rst-class:: classref-enumeration
  619. flags **SizeFlags**: :ref:`๐Ÿ”—<enum_Control_SizeFlags>`
  620. .. _class_Control_constant_SIZE_SHRINK_BEGIN:
  621. .. rst-class:: classref-enumeration-constant
  622. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_SHRINK_BEGIN** = ``0``
  623. Tells the parent :ref:`Container<class_Container>` to align the node with its start, either the top or the left edge. It is mutually exclusive with :ref:`SIZE_FILL<class_Control_constant_SIZE_FILL>` and other shrink size flags, but can be used with :ref:`SIZE_EXPAND<class_Control_constant_SIZE_EXPAND>` in some containers. Use with :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.
  624. \ **Note:** Setting this flag is equal to not having any size flags.
  625. .. _class_Control_constant_SIZE_FILL:
  626. .. rst-class:: classref-enumeration-constant
  627. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_FILL** = ``1``
  628. Tells the parent :ref:`Container<class_Container>` to expand the bounds of this node to fill all the available space without pushing any other node. It is mutually exclusive with shrink size flags. Use with :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.
  629. .. _class_Control_constant_SIZE_EXPAND:
  630. .. rst-class:: classref-enumeration-constant
  631. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_EXPAND** = ``2``
  632. Tells the parent :ref:`Container<class_Container>` to let this node take all the available space on the axis you flag. If multiple neighboring nodes are set to expand, they'll share the space based on their stretch ratio. See :ref:`size_flags_stretch_ratio<class_Control_property_size_flags_stretch_ratio>`. Use with :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.
  633. .. _class_Control_constant_SIZE_EXPAND_FILL:
  634. .. rst-class:: classref-enumeration-constant
  635. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_EXPAND_FILL** = ``3``
  636. Sets the node's size flags to both fill and expand. See :ref:`SIZE_FILL<class_Control_constant_SIZE_FILL>` and :ref:`SIZE_EXPAND<class_Control_constant_SIZE_EXPAND>` for more information.
  637. .. _class_Control_constant_SIZE_SHRINK_CENTER:
  638. .. rst-class:: classref-enumeration-constant
  639. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_SHRINK_CENTER** = ``4``
  640. Tells the parent :ref:`Container<class_Container>` to center the node in the available space. It is mutually exclusive with :ref:`SIZE_FILL<class_Control_constant_SIZE_FILL>` and other shrink size flags, but can be used with :ref:`SIZE_EXPAND<class_Control_constant_SIZE_EXPAND>` in some containers. Use with :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.
  641. .. _class_Control_constant_SIZE_SHRINK_END:
  642. .. rst-class:: classref-enumeration-constant
  643. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_SHRINK_END** = ``8``
  644. Tells the parent :ref:`Container<class_Container>` to align the node with its end, either the bottom or the right edge. It is mutually exclusive with :ref:`SIZE_FILL<class_Control_constant_SIZE_FILL>` and other shrink size flags, but can be used with :ref:`SIZE_EXPAND<class_Control_constant_SIZE_EXPAND>` in some containers. Use with :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` and :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>`.
  645. .. rst-class:: classref-item-separator
  646. ----
  647. .. _enum_Control_MouseFilter:
  648. .. rst-class:: classref-enumeration
  649. enum **MouseFilter**: :ref:`๐Ÿ”—<enum_Control_MouseFilter>`
  650. .. _class_Control_constant_MOUSE_FILTER_STOP:
  651. .. rst-class:: classref-enumeration-constant
  652. :ref:`MouseFilter<enum_Control_MouseFilter>` **MOUSE_FILTER_STOP** = ``0``
  653. The control will receive mouse movement input events and mouse button input events if clicked on through :ref:`_gui_input()<class_Control_private_method__gui_input>`. The control will also receive the :ref:`mouse_entered<class_Control_signal_mouse_entered>` and :ref:`mouse_exited<class_Control_signal_mouse_exited>` signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls.
  654. .. _class_Control_constant_MOUSE_FILTER_PASS:
  655. .. rst-class:: classref-enumeration-constant
  656. :ref:`MouseFilter<enum_Control_MouseFilter>` **MOUSE_FILTER_PASS** = ``1``
  657. The control will receive mouse movement input events and mouse button input events if clicked on through :ref:`_gui_input()<class_Control_private_method__gui_input>`. The control will also receive the :ref:`mouse_entered<class_Control_signal_mouse_entered>` and :ref:`mouse_exited<class_Control_signal_mouse_exited>` signals.
  658. If this control does not handle the event, the event will propagate up to its parent control if it has one. The event is bubbled up the node hierarchy until it reaches a non-:ref:`CanvasItem<class_CanvasItem>`, a control with :ref:`MOUSE_FILTER_STOP<class_Control_constant_MOUSE_FILTER_STOP>`, or a :ref:`CanvasItem<class_CanvasItem>` with :ref:`CanvasItem.top_level<class_CanvasItem_property_top_level>` enabled. This will allow signals to fire in all controls it reaches. If no control handled it, the event will be passed to :ref:`Node._shortcut_input()<class_Node_private_method__shortcut_input>` for further processing.
  659. .. _class_Control_constant_MOUSE_FILTER_IGNORE:
  660. .. rst-class:: classref-enumeration-constant
  661. :ref:`MouseFilter<enum_Control_MouseFilter>` **MOUSE_FILTER_IGNORE** = ``2``
  662. The control will not receive any mouse movement input events nor mouse button input events through :ref:`_gui_input()<class_Control_private_method__gui_input>`. The control will also not receive the :ref:`mouse_entered<class_Control_signal_mouse_entered>` nor :ref:`mouse_exited<class_Control_signal_mouse_exited>` signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically. If a child has :ref:`MOUSE_FILTER_PASS<class_Control_constant_MOUSE_FILTER_PASS>` and an event was passed to this control, the event will further propagate up to the control's parent.
  663. \ **Note:** If the control has received :ref:`mouse_entered<class_Control_signal_mouse_entered>` but not :ref:`mouse_exited<class_Control_signal_mouse_exited>`, changing the :ref:`mouse_filter<class_Control_property_mouse_filter>` to :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>` will cause :ref:`mouse_exited<class_Control_signal_mouse_exited>` to be emitted.
  664. .. rst-class:: classref-item-separator
  665. ----
  666. .. _enum_Control_GrowDirection:
  667. .. rst-class:: classref-enumeration
  668. enum **GrowDirection**: :ref:`๐Ÿ”—<enum_Control_GrowDirection>`
  669. .. _class_Control_constant_GROW_DIRECTION_BEGIN:
  670. .. rst-class:: classref-enumeration-constant
  671. :ref:`GrowDirection<enum_Control_GrowDirection>` **GROW_DIRECTION_BEGIN** = ``0``
  672. The control will grow to the left or top to make up if its minimum size is changed to be greater than its current size on the respective axis.
  673. .. _class_Control_constant_GROW_DIRECTION_END:
  674. .. rst-class:: classref-enumeration-constant
  675. :ref:`GrowDirection<enum_Control_GrowDirection>` **GROW_DIRECTION_END** = ``1``
  676. The control will grow to the right or bottom to make up if its minimum size is changed to be greater than its current size on the respective axis.
  677. .. _class_Control_constant_GROW_DIRECTION_BOTH:
  678. .. rst-class:: classref-enumeration-constant
  679. :ref:`GrowDirection<enum_Control_GrowDirection>` **GROW_DIRECTION_BOTH** = ``2``
  680. The control will grow in both directions equally to make up if its minimum size is changed to be greater than its current size.
  681. .. rst-class:: classref-item-separator
  682. ----
  683. .. _enum_Control_Anchor:
  684. .. rst-class:: classref-enumeration
  685. enum **Anchor**: :ref:`๐Ÿ”—<enum_Control_Anchor>`
  686. .. _class_Control_constant_ANCHOR_BEGIN:
  687. .. rst-class:: classref-enumeration-constant
  688. :ref:`Anchor<enum_Control_Anchor>` **ANCHOR_BEGIN** = ``0``
  689. Snaps one of the 4 anchor's sides to the origin of the node's ``Rect``, in the top left. Use it with one of the ``anchor_*`` member variables, like :ref:`anchor_left<class_Control_property_anchor_left>`. To change all 4 anchors at once, use :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  690. .. _class_Control_constant_ANCHOR_END:
  691. .. rst-class:: classref-enumeration-constant
  692. :ref:`Anchor<enum_Control_Anchor>` **ANCHOR_END** = ``1``
  693. Snaps one of the 4 anchor's sides to the end of the node's ``Rect``, in the bottom right. Use it with one of the ``anchor_*`` member variables, like :ref:`anchor_left<class_Control_property_anchor_left>`. To change all 4 anchors at once, use :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>`.
  694. .. rst-class:: classref-item-separator
  695. ----
  696. .. _enum_Control_LayoutDirection:
  697. .. rst-class:: classref-enumeration
  698. enum **LayoutDirection**: :ref:`๐Ÿ”—<enum_Control_LayoutDirection>`
  699. .. _class_Control_constant_LAYOUT_DIRECTION_INHERITED:
  700. .. rst-class:: classref-enumeration-constant
  701. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_INHERITED** = ``0``
  702. Automatic layout direction, determined from the parent control layout direction.
  703. .. _class_Control_constant_LAYOUT_DIRECTION_APPLICATION_LOCALE:
  704. .. rst-class:: classref-enumeration-constant
  705. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_APPLICATION_LOCALE** = ``1``
  706. Automatic layout direction, determined from the current locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew, but only if a valid translation file is loaded for the given language (unless said language is configured as a fallback in :ref:`ProjectSettings.internationalization/locale/fallback<class_ProjectSettings_property_internationalization/locale/fallback>`). For all other languages (or if no valid translation file is found by Godot), left-to-right layout direction is used. If using :ref:`TextServerFallback<class_TextServerFallback>` (:ref:`ProjectSettings.internationalization/rendering/text_driver<class_ProjectSettings_property_internationalization/rendering/text_driver>`), left-to-right layout direction is always used regardless of the language. Right-to-left layout direction can also be forced using :ref:`ProjectSettings.internationalization/rendering/force_right_to_left_layout_direction<class_ProjectSettings_property_internationalization/rendering/force_right_to_left_layout_direction>`.
  707. .. _class_Control_constant_LAYOUT_DIRECTION_LTR:
  708. .. rst-class:: classref-enumeration-constant
  709. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_LTR** = ``2``
  710. Left-to-right layout direction.
  711. .. _class_Control_constant_LAYOUT_DIRECTION_RTL:
  712. .. rst-class:: classref-enumeration-constant
  713. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_RTL** = ``3``
  714. Right-to-left layout direction.
  715. .. _class_Control_constant_LAYOUT_DIRECTION_SYSTEM_LOCALE:
  716. .. rst-class:: classref-enumeration-constant
  717. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_SYSTEM_LOCALE** = ``4``
  718. Automatic layout direction, determined from the system locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew, but only if a valid translation file is loaded for the given language.. For all other languages (or if no valid translation file is found by Godot), left-to-right layout direction is used. If using :ref:`TextServerFallback<class_TextServerFallback>` (:ref:`ProjectSettings.internationalization/rendering/text_driver<class_ProjectSettings_property_internationalization/rendering/text_driver>`), left-to-right layout direction is always used regardless of the language.
  719. .. _class_Control_constant_LAYOUT_DIRECTION_MAX:
  720. .. rst-class:: classref-enumeration-constant
  721. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_MAX** = ``5``
  722. Represents the size of the :ref:`LayoutDirection<enum_Control_LayoutDirection>` enum.
  723. .. _class_Control_constant_LAYOUT_DIRECTION_LOCALE:
  724. .. rst-class:: classref-enumeration-constant
  725. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_LOCALE** = ``1``
  726. **Deprecated:** Use :ref:`LAYOUT_DIRECTION_APPLICATION_LOCALE<class_Control_constant_LAYOUT_DIRECTION_APPLICATION_LOCALE>` instead.
  727. .. rst-class:: classref-item-separator
  728. ----
  729. .. _enum_Control_TextDirection:
  730. .. rst-class:: classref-enumeration
  731. enum **TextDirection**: :ref:`๐Ÿ”—<enum_Control_TextDirection>`
  732. .. _class_Control_constant_TEXT_DIRECTION_INHERITED:
  733. .. rst-class:: classref-enumeration-constant
  734. :ref:`TextDirection<enum_Control_TextDirection>` **TEXT_DIRECTION_INHERITED** = ``3``
  735. Text writing direction is the same as layout direction.
  736. .. _class_Control_constant_TEXT_DIRECTION_AUTO:
  737. .. rst-class:: classref-enumeration-constant
  738. :ref:`TextDirection<enum_Control_TextDirection>` **TEXT_DIRECTION_AUTO** = ``0``
  739. Automatic text writing direction, determined from the current locale and text content.
  740. .. _class_Control_constant_TEXT_DIRECTION_LTR:
  741. .. rst-class:: classref-enumeration-constant
  742. :ref:`TextDirection<enum_Control_TextDirection>` **TEXT_DIRECTION_LTR** = ``1``
  743. Left-to-right text writing direction.
  744. .. _class_Control_constant_TEXT_DIRECTION_RTL:
  745. .. rst-class:: classref-enumeration-constant
  746. :ref:`TextDirection<enum_Control_TextDirection>` **TEXT_DIRECTION_RTL** = ``2``
  747. Right-to-left text writing direction.
  748. .. rst-class:: classref-section-separator
  749. ----
  750. .. rst-class:: classref-descriptions-group
  751. Constants
  752. ---------
  753. .. _class_Control_constant_NOTIFICATION_RESIZED:
  754. .. rst-class:: classref-constant
  755. **NOTIFICATION_RESIZED** = ``40`` :ref:`๐Ÿ”—<class_Control_constant_NOTIFICATION_RESIZED>`
  756. Sent when the node changes size. Use :ref:`size<class_Control_property_size>` to get the new size.
  757. .. _class_Control_constant_NOTIFICATION_MOUSE_ENTER:
  758. .. rst-class:: classref-constant
  759. **NOTIFICATION_MOUSE_ENTER** = ``41`` :ref:`๐Ÿ”—<class_Control_constant_NOTIFICATION_MOUSE_ENTER>`
  760. Sent when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.
  761. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.
  762. See also :ref:`NOTIFICATION_MOUSE_ENTER_SELF<class_Control_constant_NOTIFICATION_MOUSE_ENTER_SELF>`.
  763. .. _class_Control_constant_NOTIFICATION_MOUSE_EXIT:
  764. .. rst-class:: classref-constant
  765. **NOTIFICATION_MOUSE_EXIT** = ``42`` :ref:`๐Ÿ”—<class_Control_constant_NOTIFICATION_MOUSE_EXIT>`
  766. Sent when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.
  767. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.
  768. See also :ref:`NOTIFICATION_MOUSE_EXIT_SELF<class_Control_constant_NOTIFICATION_MOUSE_EXIT_SELF>`.
  769. .. _class_Control_constant_NOTIFICATION_MOUSE_ENTER_SELF:
  770. .. rst-class:: classref-constant
  771. **NOTIFICATION_MOUSE_ENTER_SELF** = ``60`` :ref:`๐Ÿ”—<class_Control_constant_NOTIFICATION_MOUSE_ENTER_SELF>`
  772. **Experimental:** The reason this notification is sent may change in the future.
  773. Sent when the mouse cursor enters the control's visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.
  774. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.
  775. See also :ref:`NOTIFICATION_MOUSE_ENTER<class_Control_constant_NOTIFICATION_MOUSE_ENTER>`.
  776. .. _class_Control_constant_NOTIFICATION_MOUSE_EXIT_SELF:
  777. .. rst-class:: classref-constant
  778. **NOTIFICATION_MOUSE_EXIT_SELF** = ``61`` :ref:`๐Ÿ”—<class_Control_constant_NOTIFICATION_MOUSE_EXIT_SELF>`
  779. **Experimental:** The reason this notification is sent may change in the future.
  780. Sent when the mouse cursor leaves the control's visible area, that is not occluded behind other Controls or Windows, provided its :ref:`mouse_filter<class_Control_property_mouse_filter>` lets the event reach it and regardless if it's currently focused or not.
  781. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.
  782. See also :ref:`NOTIFICATION_MOUSE_EXIT<class_Control_constant_NOTIFICATION_MOUSE_EXIT>`.
  783. .. _class_Control_constant_NOTIFICATION_FOCUS_ENTER:
  784. .. rst-class:: classref-constant
  785. **NOTIFICATION_FOCUS_ENTER** = ``43`` :ref:`๐Ÿ”—<class_Control_constant_NOTIFICATION_FOCUS_ENTER>`
  786. Sent when the node grabs focus.
  787. .. _class_Control_constant_NOTIFICATION_FOCUS_EXIT:
  788. .. rst-class:: classref-constant
  789. **NOTIFICATION_FOCUS_EXIT** = ``44`` :ref:`๐Ÿ”—<class_Control_constant_NOTIFICATION_FOCUS_EXIT>`
  790. Sent when the node loses focus.
  791. .. _class_Control_constant_NOTIFICATION_THEME_CHANGED:
  792. .. rst-class:: classref-constant
  793. **NOTIFICATION_THEME_CHANGED** = ``45`` :ref:`๐Ÿ”—<class_Control_constant_NOTIFICATION_THEME_CHANGED>`
  794. Sent when the node needs to refresh its theme items. This happens in one of the following cases:
  795. - The :ref:`theme<class_Control_property_theme>` property is changed on this node or any of its ancestors.
  796. - The :ref:`theme_type_variation<class_Control_property_theme_type_variation>` property is changed on this node.
  797. - One of the node's theme property overrides is changed.
  798. - The node enters the scene tree.
  799. \ **Note:** As an optimization, this notification won't be sent from changes that occur while this node is outside of the scene tree. Instead, all of the theme item updates can be applied at once when the node enters the scene tree.
  800. \ **Note:** This notification is received alongside :ref:`Node.NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>`, so if you are instantiating a scene, the child nodes will not be initialized yet. You can use it to setup theming for this node, child nodes created from script, or if you want to access child nodes added in the editor, make sure the node is ready using :ref:`Node.is_node_ready()<class_Node_method_is_node_ready>`.
  801. ::
  802. func _notification(what):
  803. if what == NOTIFICATION_THEME_CHANGED:
  804. if not is_node_ready():
  805. await ready # Wait until ready signal.
  806. $Label.add_theme_color_override("font_color", Color.YELLOW)
  807. .. _class_Control_constant_NOTIFICATION_SCROLL_BEGIN:
  808. .. rst-class:: classref-constant
  809. **NOTIFICATION_SCROLL_BEGIN** = ``47`` :ref:`๐Ÿ”—<class_Control_constant_NOTIFICATION_SCROLL_BEGIN>`
  810. Sent when this node is inside a :ref:`ScrollContainer<class_ScrollContainer>` which has begun being scrolled when dragging the scrollable area *with a touch event*. This notification is *not* sent when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.
  811. \ **Note:** This signal is only emitted on Android or iOS, or on desktop/web platforms when :ref:`ProjectSettings.input_devices/pointing/emulate_touch_from_mouse<class_ProjectSettings_property_input_devices/pointing/emulate_touch_from_mouse>` is enabled.
  812. .. _class_Control_constant_NOTIFICATION_SCROLL_END:
  813. .. rst-class:: classref-constant
  814. **NOTIFICATION_SCROLL_END** = ``48`` :ref:`๐Ÿ”—<class_Control_constant_NOTIFICATION_SCROLL_END>`
  815. Sent when this node is inside a :ref:`ScrollContainer<class_ScrollContainer>` which has stopped being scrolled when dragging the scrollable area *with a touch event*. This notification is *not* sent when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.
  816. \ **Note:** This signal is only emitted on Android or iOS, or on desktop/web platforms when :ref:`ProjectSettings.input_devices/pointing/emulate_touch_from_mouse<class_ProjectSettings_property_input_devices/pointing/emulate_touch_from_mouse>` is enabled.
  817. .. _class_Control_constant_NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
  818. .. rst-class:: classref-constant
  819. **NOTIFICATION_LAYOUT_DIRECTION_CHANGED** = ``49`` :ref:`๐Ÿ”—<class_Control_constant_NOTIFICATION_LAYOUT_DIRECTION_CHANGED>`
  820. Sent when the control layout direction is changed from LTR or RTL or vice versa. This notification is propagated to child Control nodes as result of a change to :ref:`layout_direction<class_Control_property_layout_direction>`.
  821. .. rst-class:: classref-section-separator
  822. ----
  823. .. rst-class:: classref-descriptions-group
  824. Property Descriptions
  825. ---------------------
  826. .. _class_Control_property_accessibility_controls_nodes:
  827. .. rst-class:: classref-property
  828. :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **accessibility_controls_nodes** = ``[]`` :ref:`๐Ÿ”—<class_Control_property_accessibility_controls_nodes>`
  829. .. rst-class:: classref-property-setget
  830. - |void| **set_accessibility_controls_nodes**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\]\ )
  831. - :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **get_accessibility_controls_nodes**\ (\ )
  832. The paths to the nodes which are controlled by this node.
  833. .. rst-class:: classref-item-separator
  834. ----
  835. .. _class_Control_property_accessibility_described_by_nodes:
  836. .. rst-class:: classref-property
  837. :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **accessibility_described_by_nodes** = ``[]`` :ref:`๐Ÿ”—<class_Control_property_accessibility_described_by_nodes>`
  838. .. rst-class:: classref-property-setget
  839. - |void| **set_accessibility_described_by_nodes**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\]\ )
  840. - :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **get_accessibility_described_by_nodes**\ (\ )
  841. The paths to the nodes which are describing this node.
  842. .. rst-class:: classref-item-separator
  843. ----
  844. .. _class_Control_property_accessibility_description:
  845. .. rst-class:: classref-property
  846. :ref:`String<class_String>` **accessibility_description** = ``""`` :ref:`๐Ÿ”—<class_Control_property_accessibility_description>`
  847. .. rst-class:: classref-property-setget
  848. - |void| **set_accessibility_description**\ (\ value\: :ref:`String<class_String>`\ )
  849. - :ref:`String<class_String>` **get_accessibility_description**\ (\ )
  850. The human-readable node description that is reported to assistive apps.
  851. .. rst-class:: classref-item-separator
  852. ----
  853. .. _class_Control_property_accessibility_flow_to_nodes:
  854. .. rst-class:: classref-property
  855. :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **accessibility_flow_to_nodes** = ``[]`` :ref:`๐Ÿ”—<class_Control_property_accessibility_flow_to_nodes>`
  856. .. rst-class:: classref-property-setget
  857. - |void| **set_accessibility_flow_to_nodes**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\]\ )
  858. - :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **get_accessibility_flow_to_nodes**\ (\ )
  859. The paths to the nodes which this node flows into.
  860. .. rst-class:: classref-item-separator
  861. ----
  862. .. _class_Control_property_accessibility_labeled_by_nodes:
  863. .. rst-class:: classref-property
  864. :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **accessibility_labeled_by_nodes** = ``[]`` :ref:`๐Ÿ”—<class_Control_property_accessibility_labeled_by_nodes>`
  865. .. rst-class:: classref-property-setget
  866. - |void| **set_accessibility_labeled_by_nodes**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\]\ )
  867. - :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **get_accessibility_labeled_by_nodes**\ (\ )
  868. The paths to the nodes which label this node.
  869. .. rst-class:: classref-item-separator
  870. ----
  871. .. _class_Control_property_accessibility_live:
  872. .. rst-class:: classref-property
  873. :ref:`AccessibilityLiveMode<enum_DisplayServer_AccessibilityLiveMode>` **accessibility_live** = ``0`` :ref:`๐Ÿ”—<class_Control_property_accessibility_live>`
  874. .. rst-class:: classref-property-setget
  875. - |void| **set_accessibility_live**\ (\ value\: :ref:`AccessibilityLiveMode<enum_DisplayServer_AccessibilityLiveMode>`\ )
  876. - :ref:`AccessibilityLiveMode<enum_DisplayServer_AccessibilityLiveMode>` **get_accessibility_live**\ (\ )
  877. The mode with which a live region updates. A live region is a :ref:`Node<class_Node>` that is updated as a result of an external event when the user's focus may be elsewhere.
  878. .. rst-class:: classref-item-separator
  879. ----
  880. .. _class_Control_property_accessibility_name:
  881. .. rst-class:: classref-property
  882. :ref:`String<class_String>` **accessibility_name** = ``""`` :ref:`๐Ÿ”—<class_Control_property_accessibility_name>`
  883. .. rst-class:: classref-property-setget
  884. - |void| **set_accessibility_name**\ (\ value\: :ref:`String<class_String>`\ )
  885. - :ref:`String<class_String>` **get_accessibility_name**\ (\ )
  886. The human-readable node name that is reported to assistive apps.
  887. .. rst-class:: classref-item-separator
  888. ----
  889. .. _class_Control_property_anchor_bottom:
  890. .. rst-class:: classref-property
  891. :ref:`float<class_float>` **anchor_bottom** = ``0.0`` :ref:`๐Ÿ”—<class_Control_property_anchor_bottom>`
  892. .. rst-class:: classref-property-setget
  893. - :ref:`float<class_float>` **get_anchor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  894. Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom offset updates when the node moves or changes size. You can use one of the :ref:`Anchor<enum_Control_Anchor>` constants for convenience.
  895. .. rst-class:: classref-item-separator
  896. ----
  897. .. _class_Control_property_anchor_left:
  898. .. rst-class:: classref-property
  899. :ref:`float<class_float>` **anchor_left** = ``0.0`` :ref:`๐Ÿ”—<class_Control_property_anchor_left>`
  900. .. rst-class:: classref-property-setget
  901. - :ref:`float<class_float>` **get_anchor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  902. Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left offset updates when the node moves or changes size. You can use one of the :ref:`Anchor<enum_Control_Anchor>` constants for convenience.
  903. .. rst-class:: classref-item-separator
  904. ----
  905. .. _class_Control_property_anchor_right:
  906. .. rst-class:: classref-property
  907. :ref:`float<class_float>` **anchor_right** = ``0.0`` :ref:`๐Ÿ”—<class_Control_property_anchor_right>`
  908. .. rst-class:: classref-property-setget
  909. - :ref:`float<class_float>` **get_anchor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  910. Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right offset updates when the node moves or changes size. You can use one of the :ref:`Anchor<enum_Control_Anchor>` constants for convenience.
  911. .. rst-class:: classref-item-separator
  912. ----
  913. .. _class_Control_property_anchor_top:
  914. .. rst-class:: classref-property
  915. :ref:`float<class_float>` **anchor_top** = ``0.0`` :ref:`๐Ÿ”—<class_Control_property_anchor_top>`
  916. .. rst-class:: classref-property-setget
  917. - :ref:`float<class_float>` **get_anchor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  918. Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top offset updates when the node moves or changes size. You can use one of the :ref:`Anchor<enum_Control_Anchor>` constants for convenience.
  919. .. rst-class:: classref-item-separator
  920. ----
  921. .. _class_Control_property_auto_translate:
  922. .. rst-class:: classref-property
  923. :ref:`bool<class_bool>` **auto_translate** :ref:`๐Ÿ”—<class_Control_property_auto_translate>`
  924. .. rst-class:: classref-property-setget
  925. - |void| **set_auto_translate**\ (\ value\: :ref:`bool<class_bool>`\ )
  926. - :ref:`bool<class_bool>` **is_auto_translating**\ (\ )
  927. **Deprecated:** Use :ref:`Node.auto_translate_mode<class_Node_property_auto_translate_mode>` and :ref:`Node.can_auto_translate()<class_Node_method_can_auto_translate>` instead.
  928. Toggles if any text should automatically change to its translated version depending on the current locale.
  929. .. rst-class:: classref-item-separator
  930. ----
  931. .. _class_Control_property_clip_contents:
  932. .. rst-class:: classref-property
  933. :ref:`bool<class_bool>` **clip_contents** = ``false`` :ref:`๐Ÿ”—<class_Control_property_clip_contents>`
  934. .. rst-class:: classref-property-setget
  935. - |void| **set_clip_contents**\ (\ value\: :ref:`bool<class_bool>`\ )
  936. - :ref:`bool<class_bool>` **is_clipping_contents**\ (\ )
  937. Enables whether rendering of :ref:`CanvasItem<class_CanvasItem>` based children should be clipped to this control's rectangle. If ``true``, parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input.
  938. .. rst-class:: classref-item-separator
  939. ----
  940. .. _class_Control_property_custom_minimum_size:
  941. .. rst-class:: classref-property
  942. :ref:`Vector2<class_Vector2>` **custom_minimum_size** = ``Vector2(0, 0)`` :ref:`๐Ÿ”—<class_Control_property_custom_minimum_size>`
  943. .. rst-class:: classref-property-setget
  944. - |void| **set_custom_minimum_size**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  945. - :ref:`Vector2<class_Vector2>` **get_custom_minimum_size**\ (\ )
  946. The minimum size of the node's bounding rectangle. If you set it to a value greater than ``(0, 0)``, the node's bounding rectangle will always have at least this size. Note that **Control** nodes have their internal minimum size returned by :ref:`get_minimum_size()<class_Control_method_get_minimum_size>`. It depends on the control's contents, like text, textures, or style boxes. The actual minimum size is the maximum value of this property and the internal minimum size (see :ref:`get_combined_minimum_size()<class_Control_method_get_combined_minimum_size>`).
  947. .. rst-class:: classref-item-separator
  948. ----
  949. .. _class_Control_property_focus_behavior_recursive:
  950. .. rst-class:: classref-property
  951. :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` **focus_behavior_recursive** = ``0`` :ref:`๐Ÿ”—<class_Control_property_focus_behavior_recursive>`
  952. .. rst-class:: classref-property-setget
  953. - |void| **set_focus_behavior_recursive**\ (\ value\: :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>`\ )
  954. - :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` **get_focus_behavior_recursive**\ (\ )
  955. Determines which controls can be focused together with :ref:`focus_mode<class_Control_property_focus_mode>`. See :ref:`get_focus_mode_with_override()<class_Control_method_get_focus_mode_with_override>`. Since the default behavior is :ref:`FOCUS_BEHAVIOR_INHERITED<class_Control_constant_FOCUS_BEHAVIOR_INHERITED>`, this can be used to prevent all children controls from getting focused.
  956. .. rst-class:: classref-item-separator
  957. ----
  958. .. _class_Control_property_focus_mode:
  959. .. rst-class:: classref-property
  960. :ref:`FocusMode<enum_Control_FocusMode>` **focus_mode** = ``0`` :ref:`๐Ÿ”—<class_Control_property_focus_mode>`
  961. .. rst-class:: classref-property-setget
  962. - |void| **set_focus_mode**\ (\ value\: :ref:`FocusMode<enum_Control_FocusMode>`\ )
  963. - :ref:`FocusMode<enum_Control_FocusMode>` **get_focus_mode**\ (\ )
  964. Determines which controls can be focused. Only one control can be focused at a time, and the focused control will receive keyboard, gamepad, and mouse events in :ref:`_gui_input()<class_Control_private_method__gui_input>`. Use :ref:`get_focus_mode_with_override()<class_Control_method_get_focus_mode_with_override>` to determine if a control can grab focus, since :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>` also affects it. See also :ref:`grab_focus()<class_Control_method_grab_focus>`.
  965. .. rst-class:: classref-item-separator
  966. ----
  967. .. _class_Control_property_focus_neighbor_bottom:
  968. .. rst-class:: classref-property
  969. :ref:`NodePath<class_NodePath>` **focus_neighbor_bottom** = ``NodePath("")`` :ref:`๐Ÿ”—<class_Control_property_focus_neighbor_bottom>`
  970. .. rst-class:: classref-property-setget
  971. - |void| **set_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ )
  972. - :ref:`NodePath<class_NodePath>` **get_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  973. Tells Godot which node it should give focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_down<class_ProjectSettings_property_input/ui_down>` input action. The node must be a **Control**. If this property is not set, Godot will give focus to the closest **Control** to the bottom of this one.
  974. .. rst-class:: classref-item-separator
  975. ----
  976. .. _class_Control_property_focus_neighbor_left:
  977. .. rst-class:: classref-property
  978. :ref:`NodePath<class_NodePath>` **focus_neighbor_left** = ``NodePath("")`` :ref:`๐Ÿ”—<class_Control_property_focus_neighbor_left>`
  979. .. rst-class:: classref-property-setget
  980. - |void| **set_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ )
  981. - :ref:`NodePath<class_NodePath>` **get_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  982. Tells Godot which node it should give focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_left<class_ProjectSettings_property_input/ui_left>` input action. The node must be a **Control**. If this property is not set, Godot will give focus to the closest **Control** to the left of this one.
  983. .. rst-class:: classref-item-separator
  984. ----
  985. .. _class_Control_property_focus_neighbor_right:
  986. .. rst-class:: classref-property
  987. :ref:`NodePath<class_NodePath>` **focus_neighbor_right** = ``NodePath("")`` :ref:`๐Ÿ”—<class_Control_property_focus_neighbor_right>`
  988. .. rst-class:: classref-property-setget
  989. - |void| **set_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ )
  990. - :ref:`NodePath<class_NodePath>` **get_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  991. Tells Godot which node it should give focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_right<class_ProjectSettings_property_input/ui_right>` input action. The node must be a **Control**. If this property is not set, Godot will give focus to the closest **Control** to the right of this one.
  992. .. rst-class:: classref-item-separator
  993. ----
  994. .. _class_Control_property_focus_neighbor_top:
  995. .. rst-class:: classref-property
  996. :ref:`NodePath<class_NodePath>` **focus_neighbor_top** = ``NodePath("")`` :ref:`๐Ÿ”—<class_Control_property_focus_neighbor_top>`
  997. .. rst-class:: classref-property-setget
  998. - |void| **set_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ )
  999. - :ref:`NodePath<class_NodePath>` **get_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  1000. Tells Godot which node it should give focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_up<class_ProjectSettings_property_input/ui_up>` input action. The node must be a **Control**. If this property is not set, Godot will give focus to the closest **Control** to the top of this one.
  1001. .. rst-class:: classref-item-separator
  1002. ----
  1003. .. _class_Control_property_focus_next:
  1004. .. rst-class:: classref-property
  1005. :ref:`NodePath<class_NodePath>` **focus_next** = ``NodePath("")`` :ref:`๐Ÿ”—<class_Control_property_focus_next>`
  1006. .. rst-class:: classref-property-setget
  1007. - |void| **set_focus_next**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  1008. - :ref:`NodePath<class_NodePath>` **get_focus_next**\ (\ )
  1009. Tells Godot which node it should give focus to if the user presses :kbd:`Tab` on a keyboard by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_focus_next<class_ProjectSettings_property_input/ui_focus_next>` input action.
  1010. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
  1011. .. rst-class:: classref-item-separator
  1012. ----
  1013. .. _class_Control_property_focus_previous:
  1014. .. rst-class:: classref-property
  1015. :ref:`NodePath<class_NodePath>` **focus_previous** = ``NodePath("")`` :ref:`๐Ÿ”—<class_Control_property_focus_previous>`
  1016. .. rst-class:: classref-property-setget
  1017. - |void| **set_focus_previous**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  1018. - :ref:`NodePath<class_NodePath>` **get_focus_previous**\ (\ )
  1019. Tells Godot which node it should give focus to if the user presses :kbd:`Shift + Tab` on a keyboard by default. You can change the key by editing the :ref:`ProjectSettings.input/ui_focus_prev<class_ProjectSettings_property_input/ui_focus_prev>` input action.
  1020. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
  1021. .. rst-class:: classref-item-separator
  1022. ----
  1023. .. _class_Control_property_global_position:
  1024. .. rst-class:: classref-property
  1025. :ref:`Vector2<class_Vector2>` **global_position** :ref:`๐Ÿ”—<class_Control_property_global_position>`
  1026. .. rst-class:: classref-property-setget
  1027. - :ref:`Vector2<class_Vector2>` **get_global_position**\ (\ )
  1028. The node's global position, relative to the world (usually to the :ref:`CanvasLayer<class_CanvasLayer>`).
  1029. .. rst-class:: classref-item-separator
  1030. ----
  1031. .. _class_Control_property_grow_horizontal:
  1032. .. rst-class:: classref-property
  1033. :ref:`GrowDirection<enum_Control_GrowDirection>` **grow_horizontal** = ``1`` :ref:`๐Ÿ”—<class_Control_property_grow_horizontal>`
  1034. .. rst-class:: classref-property-setget
  1035. - |void| **set_h_grow_direction**\ (\ value\: :ref:`GrowDirection<enum_Control_GrowDirection>`\ )
  1036. - :ref:`GrowDirection<enum_Control_GrowDirection>` **get_h_grow_direction**\ (\ )
  1037. Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size.
  1038. .. rst-class:: classref-item-separator
  1039. ----
  1040. .. _class_Control_property_grow_vertical:
  1041. .. rst-class:: classref-property
  1042. :ref:`GrowDirection<enum_Control_GrowDirection>` **grow_vertical** = ``1`` :ref:`๐Ÿ”—<class_Control_property_grow_vertical>`
  1043. .. rst-class:: classref-property-setget
  1044. - |void| **set_v_grow_direction**\ (\ value\: :ref:`GrowDirection<enum_Control_GrowDirection>`\ )
  1045. - :ref:`GrowDirection<enum_Control_GrowDirection>` **get_v_grow_direction**\ (\ )
  1046. Controls the direction on the vertical axis in which the control should grow if its vertical minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size.
  1047. .. rst-class:: classref-item-separator
  1048. ----
  1049. .. _class_Control_property_layout_direction:
  1050. .. rst-class:: classref-property
  1051. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **layout_direction** = ``0`` :ref:`๐Ÿ”—<class_Control_property_layout_direction>`
  1052. .. rst-class:: classref-property-setget
  1053. - |void| **set_layout_direction**\ (\ value\: :ref:`LayoutDirection<enum_Control_LayoutDirection>`\ )
  1054. - :ref:`LayoutDirection<enum_Control_LayoutDirection>` **get_layout_direction**\ (\ )
  1055. Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). See also :ref:`is_layout_rtl()<class_Control_method_is_layout_rtl>`.
  1056. .. rst-class:: classref-item-separator
  1057. ----
  1058. .. _class_Control_property_localize_numeral_system:
  1059. .. rst-class:: classref-property
  1060. :ref:`bool<class_bool>` **localize_numeral_system** = ``true`` :ref:`๐Ÿ”—<class_Control_property_localize_numeral_system>`
  1061. .. rst-class:: classref-property-setget
  1062. - |void| **set_localize_numeral_system**\ (\ value\: :ref:`bool<class_bool>`\ )
  1063. - :ref:`bool<class_bool>` **is_localizing_numeral_system**\ (\ )
  1064. If ``true``, automatically converts code line numbers, list indices, :ref:`SpinBox<class_SpinBox>` and :ref:`ProgressBar<class_ProgressBar>` values from the Western Arabic (0..9) to the numeral systems used in current locale.
  1065. \ **Note:** Numbers within the text are not automatically converted, it can be done manually, using :ref:`TextServer.format_number()<class_TextServer_method_format_number>`.
  1066. .. rst-class:: classref-item-separator
  1067. ----
  1068. .. _class_Control_property_mouse_behavior_recursive:
  1069. .. rst-class:: classref-property
  1070. :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` **mouse_behavior_recursive** = ``0`` :ref:`๐Ÿ”—<class_Control_property_mouse_behavior_recursive>`
  1071. .. rst-class:: classref-property-setget
  1072. - |void| **set_mouse_behavior_recursive**\ (\ value\: :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>`\ )
  1073. - :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` **get_mouse_behavior_recursive**\ (\ )
  1074. Determines which controls can receive mouse input together with :ref:`mouse_filter<class_Control_property_mouse_filter>`. See :ref:`get_mouse_filter_with_override()<class_Control_method_get_mouse_filter_with_override>`. Since the default behavior is :ref:`MOUSE_BEHAVIOR_INHERITED<class_Control_constant_MOUSE_BEHAVIOR_INHERITED>`, this can be used to prevent all children controls from receiving mouse input.
  1075. .. rst-class:: classref-item-separator
  1076. ----
  1077. .. _class_Control_property_mouse_default_cursor_shape:
  1078. .. rst-class:: classref-property
  1079. :ref:`CursorShape<enum_Control_CursorShape>` **mouse_default_cursor_shape** = ``0`` :ref:`๐Ÿ”—<class_Control_property_mouse_default_cursor_shape>`
  1080. .. rst-class:: classref-property-setget
  1081. - |void| **set_default_cursor_shape**\ (\ value\: :ref:`CursorShape<enum_Control_CursorShape>`\ )
  1082. - :ref:`CursorShape<enum_Control_CursorShape>` **get_default_cursor_shape**\ (\ )
  1083. The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors.
  1084. \ **Note:** On Linux, shapes may vary depending on the cursor theme of the system.
  1085. .. rst-class:: classref-item-separator
  1086. ----
  1087. .. _class_Control_property_mouse_filter:
  1088. .. rst-class:: classref-property
  1089. :ref:`MouseFilter<enum_Control_MouseFilter>` **mouse_filter** = ``0`` :ref:`๐Ÿ”—<class_Control_property_mouse_filter>`
  1090. .. rst-class:: classref-property-setget
  1091. - |void| **set_mouse_filter**\ (\ value\: :ref:`MouseFilter<enum_Control_MouseFilter>`\ )
  1092. - :ref:`MouseFilter<enum_Control_MouseFilter>` **get_mouse_filter**\ (\ )
  1093. Determines which controls will be able to receive mouse button input events through :ref:`_gui_input()<class_Control_private_method__gui_input>` and the :ref:`mouse_entered<class_Control_signal_mouse_entered>`, and :ref:`mouse_exited<class_Control_signal_mouse_exited>` signals. Also determines how these events should be propagated. See the constants to learn what each does. Use :ref:`get_mouse_filter_with_override()<class_Control_method_get_mouse_filter_with_override>` to determine if a control can receive mouse input, since :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>` also affects it.
  1094. .. rst-class:: classref-item-separator
  1095. ----
  1096. .. _class_Control_property_mouse_force_pass_scroll_events:
  1097. .. rst-class:: classref-property
  1098. :ref:`bool<class_bool>` **mouse_force_pass_scroll_events** = ``true`` :ref:`๐Ÿ”—<class_Control_property_mouse_force_pass_scroll_events>`
  1099. .. rst-class:: classref-property-setget
  1100. - |void| **set_force_pass_scroll_events**\ (\ value\: :ref:`bool<class_bool>`\ )
  1101. - :ref:`bool<class_bool>` **is_force_pass_scroll_events**\ (\ )
  1102. When enabled, scroll wheel events processed by :ref:`_gui_input()<class_Control_private_method__gui_input>` will be passed to the parent control even if :ref:`mouse_filter<class_Control_property_mouse_filter>` is set to :ref:`MOUSE_FILTER_STOP<class_Control_constant_MOUSE_FILTER_STOP>`.
  1103. You should disable it on the root of your UI if you do not want scroll events to go to the :ref:`Node._unhandled_input()<class_Node_private_method__unhandled_input>` processing.
  1104. \ **Note:** Because this property defaults to ``true``, this allows nested scrollable containers to work out of the box.
  1105. .. rst-class:: classref-item-separator
  1106. ----
  1107. .. _class_Control_property_offset_bottom:
  1108. .. rst-class:: classref-property
  1109. :ref:`float<class_float>` **offset_bottom** = ``0.0`` :ref:`๐Ÿ”—<class_Control_property_offset_bottom>`
  1110. .. rst-class:: classref-property-setget
  1111. - |void| **set_offset**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ )
  1112. - :ref:`float<class_float>` **get_offset**\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  1113. Distance between the node's bottom edge and its parent control, based on :ref:`anchor_bottom<class_Control_property_anchor_bottom>`.
  1114. Offsets are often controlled by one or multiple parent :ref:`Container<class_Container>` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container<class_Container>`. Offsets update automatically when you move or resize the node.
  1115. .. rst-class:: classref-item-separator
  1116. ----
  1117. .. _class_Control_property_offset_left:
  1118. .. rst-class:: classref-property
  1119. :ref:`float<class_float>` **offset_left** = ``0.0`` :ref:`๐Ÿ”—<class_Control_property_offset_left>`
  1120. .. rst-class:: classref-property-setget
  1121. - |void| **set_offset**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ )
  1122. - :ref:`float<class_float>` **get_offset**\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  1123. Distance between the node's left edge and its parent control, based on :ref:`anchor_left<class_Control_property_anchor_left>`.
  1124. Offsets are often controlled by one or multiple parent :ref:`Container<class_Container>` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container<class_Container>`. Offsets update automatically when you move or resize the node.
  1125. .. rst-class:: classref-item-separator
  1126. ----
  1127. .. _class_Control_property_offset_right:
  1128. .. rst-class:: classref-property
  1129. :ref:`float<class_float>` **offset_right** = ``0.0`` :ref:`๐Ÿ”—<class_Control_property_offset_right>`
  1130. .. rst-class:: classref-property-setget
  1131. - |void| **set_offset**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ )
  1132. - :ref:`float<class_float>` **get_offset**\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  1133. Distance between the node's right edge and its parent control, based on :ref:`anchor_right<class_Control_property_anchor_right>`.
  1134. Offsets are often controlled by one or multiple parent :ref:`Container<class_Container>` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container<class_Container>`. Offsets update automatically when you move or resize the node.
  1135. .. rst-class:: classref-item-separator
  1136. ----
  1137. .. _class_Control_property_offset_top:
  1138. .. rst-class:: classref-property
  1139. :ref:`float<class_float>` **offset_top** = ``0.0`` :ref:`๐Ÿ”—<class_Control_property_offset_top>`
  1140. .. rst-class:: classref-property-setget
  1141. - |void| **set_offset**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ )
  1142. - :ref:`float<class_float>` **get_offset**\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  1143. Distance between the node's top edge and its parent control, based on :ref:`anchor_top<class_Control_property_anchor_top>`.
  1144. Offsets are often controlled by one or multiple parent :ref:`Container<class_Container>` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container<class_Container>`. Offsets update automatically when you move or resize the node.
  1145. .. rst-class:: classref-item-separator
  1146. ----
  1147. .. _class_Control_property_pivot_offset:
  1148. .. rst-class:: classref-property
  1149. :ref:`Vector2<class_Vector2>` **pivot_offset** = ``Vector2(0, 0)`` :ref:`๐Ÿ”—<class_Control_property_pivot_offset>`
  1150. .. rst-class:: classref-property-setget
  1151. - |void| **set_pivot_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  1152. - :ref:`Vector2<class_Vector2>` **get_pivot_offset**\ (\ )
  1153. By default, the node's pivot is its top-left corner. When you change its :ref:`rotation<class_Control_property_rotation>` or :ref:`scale<class_Control_property_scale>`, it will rotate or scale around this pivot. Set this property to :ref:`size<class_Control_property_size>` / 2 to pivot around the Control's center.
  1154. .. rst-class:: classref-item-separator
  1155. ----
  1156. .. _class_Control_property_position:
  1157. .. rst-class:: classref-property
  1158. :ref:`Vector2<class_Vector2>` **position** = ``Vector2(0, 0)`` :ref:`๐Ÿ”—<class_Control_property_position>`
  1159. .. rst-class:: classref-property-setget
  1160. - :ref:`Vector2<class_Vector2>` **get_position**\ (\ )
  1161. The node's position, relative to its containing node. It corresponds to the rectangle's top-left corner. The property is not affected by :ref:`pivot_offset<class_Control_property_pivot_offset>`.
  1162. .. rst-class:: classref-item-separator
  1163. ----
  1164. .. _class_Control_property_rotation:
  1165. .. rst-class:: classref-property
  1166. :ref:`float<class_float>` **rotation** = ``0.0`` :ref:`๐Ÿ”—<class_Control_property_rotation>`
  1167. .. rst-class:: classref-property-setget
  1168. - |void| **set_rotation**\ (\ value\: :ref:`float<class_float>`\ )
  1169. - :ref:`float<class_float>` **get_rotation**\ (\ )
  1170. The node's rotation around its pivot, in radians. See :ref:`pivot_offset<class_Control_property_pivot_offset>` to change the pivot's position.
  1171. \ **Note:** This property is edited in the inspector in degrees. If you want to use degrees in a script, use :ref:`rotation_degrees<class_Control_property_rotation_degrees>`.
  1172. .. rst-class:: classref-item-separator
  1173. ----
  1174. .. _class_Control_property_rotation_degrees:
  1175. .. rst-class:: classref-property
  1176. :ref:`float<class_float>` **rotation_degrees** :ref:`๐Ÿ”—<class_Control_property_rotation_degrees>`
  1177. .. rst-class:: classref-property-setget
  1178. - |void| **set_rotation_degrees**\ (\ value\: :ref:`float<class_float>`\ )
  1179. - :ref:`float<class_float>` **get_rotation_degrees**\ (\ )
  1180. Helper property to access :ref:`rotation<class_Control_property_rotation>` in degrees instead of radians.
  1181. .. rst-class:: classref-item-separator
  1182. ----
  1183. .. _class_Control_property_scale:
  1184. .. rst-class:: classref-property
  1185. :ref:`Vector2<class_Vector2>` **scale** = ``Vector2(1, 1)`` :ref:`๐Ÿ”—<class_Control_property_scale>`
  1186. .. rst-class:: classref-property-setget
  1187. - |void| **set_scale**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  1188. - :ref:`Vector2<class_Vector2>` **get_scale**\ (\ )
  1189. The node's scale, relative to its :ref:`size<class_Control_property_size>`. Change this property to scale the node around its :ref:`pivot_offset<class_Control_property_pivot_offset>`. The Control's tooltip will also scale according to this value.
  1190. \ **Note:** This property is mainly intended to be used for animation purposes. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the :doc:`documentation <../tutorials/rendering/multiple_resolutions>` instead of scaling Controls individually.
  1191. \ **Note:** :ref:`FontFile.oversampling<class_FontFile_property_oversampling>` does *not* take **Control** :ref:`scale<class_Control_property_scale>` into account. This means that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font rendering by enabling :ref:`ProjectSettings.gui/theme/default_font_multichannel_signed_distance_field<class_ProjectSettings_property_gui/theme/default_font_multichannel_signed_distance_field>` (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in the import options of a DynamicFont for custom fonts. On system fonts, :ref:`SystemFont.multichannel_signed_distance_field<class_SystemFont_property_multichannel_signed_distance_field>` can be enabled in the inspector.
  1192. \ **Note:** If the Control node is a child of a :ref:`Container<class_Container>` node, the scale will be reset to ``Vector2(1, 1)`` when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using ``await get_tree().process_frame`` then set its :ref:`scale<class_Control_property_scale>` property.
  1193. .. rst-class:: classref-item-separator
  1194. ----
  1195. .. _class_Control_property_shortcut_context:
  1196. .. rst-class:: classref-property
  1197. :ref:`Node<class_Node>` **shortcut_context** :ref:`๐Ÿ”—<class_Control_property_shortcut_context>`
  1198. .. rst-class:: classref-property-setget
  1199. - |void| **set_shortcut_context**\ (\ value\: :ref:`Node<class_Node>`\ )
  1200. - :ref:`Node<class_Node>` **get_shortcut_context**\ (\ )
  1201. The :ref:`Node<class_Node>` which must be a parent of the focused **Control** for the shortcut to be activated. If ``null``, the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused.
  1202. .. rst-class:: classref-item-separator
  1203. ----
  1204. .. _class_Control_property_size:
  1205. .. rst-class:: classref-property
  1206. :ref:`Vector2<class_Vector2>` **size** = ``Vector2(0, 0)`` :ref:`๐Ÿ”—<class_Control_property_size>`
  1207. .. rst-class:: classref-property-setget
  1208. - :ref:`Vector2<class_Vector2>` **get_size**\ (\ )
  1209. The size of the node's bounding rectangle, in the node's coordinate system. :ref:`Container<class_Container>` nodes update this property automatically.
  1210. .. rst-class:: classref-item-separator
  1211. ----
  1212. .. _class_Control_property_size_flags_horizontal:
  1213. .. rst-class:: classref-property
  1214. |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] **size_flags_horizontal** = ``1`` :ref:`๐Ÿ”—<class_Control_property_size_flags_horizontal>`
  1215. .. rst-class:: classref-property-setget
  1216. - |void| **set_h_size_flags**\ (\ value\: |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\]\ )
  1217. - |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] **get_h_size_flags**\ (\ )
  1218. Tells the parent :ref:`Container<class_Container>` nodes how they should resize and place the node on the X axis. Use a combination of the :ref:`SizeFlags<enum_Control_SizeFlags>` constants to change the flags. See the constants to learn what each does.
  1219. .. rst-class:: classref-item-separator
  1220. ----
  1221. .. _class_Control_property_size_flags_stretch_ratio:
  1222. .. rst-class:: classref-property
  1223. :ref:`float<class_float>` **size_flags_stretch_ratio** = ``1.0`` :ref:`๐Ÿ”—<class_Control_property_size_flags_stretch_ratio>`
  1224. .. rst-class:: classref-property-setget
  1225. - |void| **set_stretch_ratio**\ (\ value\: :ref:`float<class_float>`\ )
  1226. - :ref:`float<class_float>` **get_stretch_ratio**\ (\ )
  1227. If the node and at least one of its neighbors uses the :ref:`SIZE_EXPAND<class_Control_constant_SIZE_EXPAND>` size flag, the parent :ref:`Container<class_Container>` will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbor a ratio of 1, this node will take two thirds of the available space.
  1228. .. rst-class:: classref-item-separator
  1229. ----
  1230. .. _class_Control_property_size_flags_vertical:
  1231. .. rst-class:: classref-property
  1232. |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] **size_flags_vertical** = ``1`` :ref:`๐Ÿ”—<class_Control_property_size_flags_vertical>`
  1233. .. rst-class:: classref-property-setget
  1234. - |void| **set_v_size_flags**\ (\ value\: |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\]\ )
  1235. - |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] **get_v_size_flags**\ (\ )
  1236. Tells the parent :ref:`Container<class_Container>` nodes how they should resize and place the node on the Y axis. Use a combination of the :ref:`SizeFlags<enum_Control_SizeFlags>` constants to change the flags. See the constants to learn what each does.
  1237. .. rst-class:: classref-item-separator
  1238. ----
  1239. .. _class_Control_property_theme:
  1240. .. rst-class:: classref-property
  1241. :ref:`Theme<class_Theme>` **theme** :ref:`๐Ÿ”—<class_Control_property_theme>`
  1242. .. rst-class:: classref-property-setget
  1243. - |void| **set_theme**\ (\ value\: :ref:`Theme<class_Theme>`\ )
  1244. - :ref:`Theme<class_Theme>` **get_theme**\ (\ )
  1245. The :ref:`Theme<class_Theme>` resource this node and all its **Control** and :ref:`Window<class_Window>` children use. If a child node has its own :ref:`Theme<class_Theme>` resource set, theme items are merged with child's definitions having higher priority.
  1246. \ **Note:** :ref:`Window<class_Window>` styles will have no effect unless the window is embedded.
  1247. .. rst-class:: classref-item-separator
  1248. ----
  1249. .. _class_Control_property_theme_type_variation:
  1250. .. rst-class:: classref-property
  1251. :ref:`StringName<class_StringName>` **theme_type_variation** = ``&""`` :ref:`๐Ÿ”—<class_Control_property_theme_type_variation>`
  1252. .. rst-class:: classref-property-setget
  1253. - |void| **set_theme_type_variation**\ (\ value\: :ref:`StringName<class_StringName>`\ )
  1254. - :ref:`StringName<class_StringName>` **get_theme_type_variation**\ (\ )
  1255. The name of a theme type variation used by this **Control** to look up its own theme items. When empty, the class name of the node is used (e.g. ``Button`` for the :ref:`Button<class_Button>` control), as well as the class names of all parent classes (in order of inheritance).
  1256. When set, this property gives the highest priority to the type of the specified name. This type can in turn extend another type, forming a dependency chain. See :ref:`Theme.set_type_variation()<class_Theme_method_set_type_variation>`. If the theme item cannot be found using this type or its base types, lookup falls back on the class names.
  1257. \ **Note:** To look up **Control**'s own items use various ``get_theme_*`` methods without specifying ``theme_type``.
  1258. \ **Note:** Theme items are looked for in the tree order, from branch to root, where each **Control** node is checked for its :ref:`theme<class_Control_property_theme>` property. The earliest match against any type/class name is returned. The project-level Theme and the default Theme are checked last.
  1259. .. rst-class:: classref-item-separator
  1260. ----
  1261. .. _class_Control_property_tooltip_auto_translate_mode:
  1262. .. rst-class:: classref-property
  1263. :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` **tooltip_auto_translate_mode** = ``0`` :ref:`๐Ÿ”—<class_Control_property_tooltip_auto_translate_mode>`
  1264. .. rst-class:: classref-property-setget
  1265. - |void| **set_tooltip_auto_translate_mode**\ (\ value\: :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>`\ )
  1266. - :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` **get_tooltip_auto_translate_mode**\ (\ )
  1267. Defines if tooltip text should automatically change to its translated version depending on the current locale. Uses the same auto translate mode as this control when set to :ref:`Node.AUTO_TRANSLATE_MODE_INHERIT<class_Node_constant_AUTO_TRANSLATE_MODE_INHERIT>`.
  1268. \ **Note:** Tooltips customized using :ref:`_make_custom_tooltip()<class_Control_private_method__make_custom_tooltip>` do not use this auto translate mode automatically.
  1269. .. rst-class:: classref-item-separator
  1270. ----
  1271. .. _class_Control_property_tooltip_text:
  1272. .. rst-class:: classref-property
  1273. :ref:`String<class_String>` **tooltip_text** = ``""`` :ref:`๐Ÿ”—<class_Control_property_tooltip_text>`
  1274. .. rst-class:: classref-property-setget
  1275. - |void| **set_tooltip_text**\ (\ value\: :ref:`String<class_String>`\ )
  1276. - :ref:`String<class_String>` **get_tooltip_text**\ (\ )
  1277. The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the :ref:`mouse_filter<class_Control_property_mouse_filter>` property is not :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>`. The time required for the tooltip to appear can be changed with the :ref:`ProjectSettings.gui/timers/tooltip_delay_sec<class_ProjectSettings_property_gui/timers/tooltip_delay_sec>` setting.
  1278. This string is the default return value of :ref:`get_tooltip()<class_Control_method_get_tooltip>`. Override :ref:`_get_tooltip()<class_Control_private_method__get_tooltip>` to generate tooltip text dynamically. Override :ref:`_make_custom_tooltip()<class_Control_private_method__make_custom_tooltip>` to customize the tooltip interface and behavior.
  1279. The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding :ref:`_make_custom_tooltip()<class_Control_private_method__make_custom_tooltip>`. The default tooltip includes a :ref:`PopupPanel<class_PopupPanel>` and :ref:`Label<class_Label>` whose theme properties can be customized using :ref:`Theme<class_Theme>` methods with the ``"TooltipPanel"`` and ``"TooltipLabel"`` respectively. For example:
  1280. .. tabs::
  1281. .. code-tab:: gdscript
  1282. var style_box = StyleBoxFlat.new()
  1283. style_box.set_bg_color(Color(1, 1, 0))
  1284. style_box.set_border_width_all(2)
  1285. # We assume here that the `theme` property has been assigned a custom Theme beforehand.
  1286. theme.set_stylebox("panel", "TooltipPanel", style_box)
  1287. theme.set_color("font_color", "TooltipLabel", Color(0, 1, 1))
  1288. .. code-tab:: csharp
  1289. var styleBox = new StyleBoxFlat();
  1290. styleBox.SetBgColor(new Color(1, 1, 0));
  1291. styleBox.SetBorderWidthAll(2);
  1292. // We assume here that the `Theme` property has been assigned a custom Theme beforehand.
  1293. Theme.SetStyleBox("panel", "TooltipPanel", styleBox);
  1294. Theme.SetColor("font_color", "TooltipLabel", new Color(0, 1, 1));
  1295. .. rst-class:: classref-section-separator
  1296. ----
  1297. .. rst-class:: classref-descriptions-group
  1298. Method Descriptions
  1299. -------------------
  1300. .. _class_Control_private_method__accessibility_get_contextual_info:
  1301. .. rst-class:: classref-method
  1302. :ref:`String<class_String>` **_accessibility_get_contextual_info**\ (\ ) |virtual| |const| :ref:`๐Ÿ”—<class_Control_private_method__accessibility_get_contextual_info>`
  1303. Return the description of the keyboard shortcuts and other contextual help for this control.
  1304. .. rst-class:: classref-item-separator
  1305. ----
  1306. .. _class_Control_private_method__can_drop_data:
  1307. .. rst-class:: classref-method
  1308. :ref:`bool<class_bool>` **_can_drop_data**\ (\ at_position\: :ref:`Vector2<class_Vector2>`, data\: :ref:`Variant<class_Variant>`\ ) |virtual| |const| :ref:`๐Ÿ”—<class_Control_private_method__can_drop_data>`
  1309. Godot calls this method to test if ``data`` from a control's :ref:`_get_drag_data()<class_Control_private_method__get_drag_data>` can be dropped at ``at_position``. ``at_position`` is local to this control.
  1310. This method should only be used to test the data. Process the data in :ref:`_drop_data()<class_Control_private_method__drop_data>`.
  1311. \ **Note:** If the drag was initiated by a keyboard shortcut or :ref:`accessibility_drag()<class_Control_method_accessibility_drag>`, ``at_position`` is set to :ref:`Vector2.INF<class_Vector2_constant_INF>`, and the currently selected item/text position should be used as the drop position.
  1312. .. tabs::
  1313. .. code-tab:: gdscript
  1314. func _can_drop_data(position, data):
  1315. # Check position if it is relevant to you
  1316. # Otherwise, just check data
  1317. return typeof(data) == TYPE_DICTIONARY and data.has("expected")
  1318. .. code-tab:: csharp
  1319. public override bool _CanDropData(Vector2 atPosition, Variant data)
  1320. {
  1321. // Check position if it is relevant to you
  1322. // Otherwise, just check data
  1323. return data.VariantType == Variant.Type.Dictionary && data.AsGodotDictionary().ContainsKey("expected");
  1324. }
  1325. .. rst-class:: classref-item-separator
  1326. ----
  1327. .. _class_Control_private_method__drop_data:
  1328. .. rst-class:: classref-method
  1329. |void| **_drop_data**\ (\ at_position\: :ref:`Vector2<class_Vector2>`, data\: :ref:`Variant<class_Variant>`\ ) |virtual| :ref:`๐Ÿ”—<class_Control_private_method__drop_data>`
  1330. Godot calls this method to pass you the ``data`` from a control's :ref:`_get_drag_data()<class_Control_private_method__get_drag_data>` result. Godot first calls :ref:`_can_drop_data()<class_Control_private_method__can_drop_data>` to test if ``data`` is allowed to drop at ``at_position`` where ``at_position`` is local to this control.
  1331. \ **Note:** If the drag was initiated by a keyboard shortcut or :ref:`accessibility_drag()<class_Control_method_accessibility_drag>`, ``at_position`` is set to :ref:`Vector2.INF<class_Vector2_constant_INF>`, and the currently selected item/text position should be used as the drop position.
  1332. .. tabs::
  1333. .. code-tab:: gdscript
  1334. func _can_drop_data(position, data):
  1335. return typeof(data) == TYPE_DICTIONARY and data.has("color")
  1336. func _drop_data(position, data):
  1337. var color = data["color"]
  1338. .. code-tab:: csharp
  1339. public override bool _CanDropData(Vector2 atPosition, Variant data)
  1340. {
  1341. return data.VariantType == Variant.Type.Dictionary && data.AsGodotDictionary().ContainsKey("color");
  1342. }
  1343. public override void _DropData(Vector2 atPosition, Variant data)
  1344. {
  1345. Color color = data.AsGodotDictionary()["color"].AsColor();
  1346. }
  1347. .. rst-class:: classref-item-separator
  1348. ----
  1349. .. _class_Control_private_method__get_accessibility_container_name:
  1350. .. rst-class:: classref-method
  1351. :ref:`String<class_String>` **_get_accessibility_container_name**\ (\ node\: :ref:`Node<class_Node>`\ ) |virtual| |const| :ref:`๐Ÿ”—<class_Control_private_method__get_accessibility_container_name>`
  1352. Override this method to return a human-readable description of the position of the child ``node`` in the custom container, added to the :ref:`accessibility_name<class_Control_property_accessibility_name>`.
  1353. .. rst-class:: classref-item-separator
  1354. ----
  1355. .. _class_Control_private_method__get_drag_data:
  1356. .. rst-class:: classref-method
  1357. :ref:`Variant<class_Variant>` **_get_drag_data**\ (\ at_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| :ref:`๐Ÿ”—<class_Control_private_method__get_drag_data>`
  1358. Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns ``null`` if there is no data to drag. Controls that want to receive drop data should implement :ref:`_can_drop_data()<class_Control_private_method__can_drop_data>` and :ref:`_drop_data()<class_Control_private_method__drop_data>`. ``at_position`` is local to this control. Drag may be forced with :ref:`force_drag()<class_Control_method_force_drag>`.
  1359. A preview that will follow the mouse that should represent the data can be set with :ref:`set_drag_preview()<class_Control_method_set_drag_preview>`. A good time to set the preview is in this method.
  1360. \ **Note:** If the drag was initiated by a keyboard shortcut or :ref:`accessibility_drag()<class_Control_method_accessibility_drag>`, ``at_position`` is set to :ref:`Vector2.INF<class_Vector2_constant_INF>`, and the currently selected item/text position should be used as the drag position.
  1361. .. tabs::
  1362. .. code-tab:: gdscript
  1363. func _get_drag_data(position):
  1364. var mydata = make_data() # This is your custom method generating the drag data.
  1365. set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview of the drag data.
  1366. return mydata
  1367. .. code-tab:: csharp
  1368. public override Variant _GetDragData(Vector2 atPosition)
  1369. {
  1370. var myData = MakeData(); // This is your custom method generating the drag data.
  1371. SetDragPreview(MakePreview(myData)); // This is your custom method generating the preview of the drag data.
  1372. return myData;
  1373. }
  1374. .. rst-class:: classref-item-separator
  1375. ----
  1376. .. _class_Control_private_method__get_minimum_size:
  1377. .. rst-class:: classref-method
  1378. :ref:`Vector2<class_Vector2>` **_get_minimum_size**\ (\ ) |virtual| |const| :ref:`๐Ÿ”—<class_Control_private_method__get_minimum_size>`
  1379. Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>` for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately).
  1380. If not overridden, defaults to :ref:`Vector2.ZERO<class_Vector2_constant_ZERO>`.
  1381. \ **Note:** This method will not be called when the script is attached to a **Control** node that already overrides its minimum size (e.g. :ref:`Label<class_Label>`, :ref:`Button<class_Button>`, :ref:`PanelContainer<class_PanelContainer>` etc.). It can only be used with most basic GUI nodes, like **Control**, :ref:`Container<class_Container>`, :ref:`Panel<class_Panel>` etc.
  1382. .. rst-class:: classref-item-separator
  1383. ----
  1384. .. _class_Control_private_method__get_tooltip:
  1385. .. rst-class:: classref-method
  1386. :ref:`String<class_String>` **_get_tooltip**\ (\ at_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |const| :ref:`๐Ÿ”—<class_Control_private_method__get_tooltip>`
  1387. Virtual method to be implemented by the user. Returns the tooltip text for the position ``at_position`` in control's local coordinates, which will typically appear when the cursor is resting over this control. See :ref:`get_tooltip()<class_Control_method_get_tooltip>`.
  1388. \ **Note:** If this method returns an empty :ref:`String<class_String>` and :ref:`_make_custom_tooltip()<class_Control_private_method__make_custom_tooltip>` is not overridden, no tooltip is displayed.
  1389. .. rst-class:: classref-item-separator
  1390. ----
  1391. .. _class_Control_private_method__gui_input:
  1392. .. rst-class:: classref-method
  1393. |void| **_gui_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual| :ref:`๐Ÿ”—<class_Control_private_method__gui_input>`
  1394. Virtual method to be implemented by the user. Override this method to handle and accept inputs on UI elements. See also :ref:`accept_event()<class_Control_method_accept_event>`.
  1395. \ **Example:** Click on the control to print a message:
  1396. .. tabs::
  1397. .. code-tab:: gdscript
  1398. func _gui_input(event):
  1399. if event is InputEventMouseButton:
  1400. if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
  1401. print("I've been clicked D:")
  1402. .. code-tab:: csharp
  1403. public override void _GuiInput(InputEvent @event)
  1404. {
  1405. if (@event is InputEventMouseButton mb)
  1406. {
  1407. if (mb.ButtonIndex == MouseButton.Left && mb.Pressed)
  1408. {
  1409. GD.Print("I've been clicked D:");
  1410. }
  1411. }
  1412. }
  1413. If the ``event`` inherits :ref:`InputEventMouse<class_InputEventMouse>`, this method will **not** be called when:
  1414. - the control's :ref:`mouse_filter<class_Control_property_mouse_filter>` is set to :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>`;
  1415. - the control is obstructed by another control on top, that doesn't have :ref:`mouse_filter<class_Control_property_mouse_filter>` set to :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>`;
  1416. - the control's parent has :ref:`mouse_filter<class_Control_property_mouse_filter>` set to :ref:`MOUSE_FILTER_STOP<class_Control_constant_MOUSE_FILTER_STOP>` or has accepted the event;
  1417. - the control's parent has :ref:`clip_contents<class_Control_property_clip_contents>` enabled and the ``event``'s position is outside the parent's rectangle;
  1418. - the ``event``'s position is outside the control (see :ref:`_has_point()<class_Control_private_method__has_point>`).
  1419. \ **Note:** The ``event``'s position is relative to this control's origin.
  1420. .. rst-class:: classref-item-separator
  1421. ----
  1422. .. _class_Control_private_method__has_point:
  1423. .. rst-class:: classref-method
  1424. :ref:`bool<class_bool>` **_has_point**\ (\ point\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |const| :ref:`๐Ÿ”—<class_Control_private_method__has_point>`
  1425. Virtual method to be implemented by the user. Returns whether the given ``point`` is inside this control.
  1426. If not overridden, default behavior is checking if the point is within control's Rect.
  1427. \ **Note:** If you want to check if a point is inside the control, you can use ``Rect2(Vector2.ZERO, size).has_point(point)``.
  1428. .. rst-class:: classref-item-separator
  1429. ----
  1430. .. _class_Control_private_method__make_custom_tooltip:
  1431. .. rst-class:: classref-method
  1432. :ref:`Object<class_Object>` **_make_custom_tooltip**\ (\ for_text\: :ref:`String<class_String>`\ ) |virtual| |const| :ref:`๐Ÿ”—<class_Control_private_method__make_custom_tooltip>`
  1433. Virtual method to be implemented by the user. Returns a **Control** node that should be used as a tooltip instead of the default one. ``for_text`` is the return value of :ref:`get_tooltip()<class_Control_method_get_tooltip>`.
  1434. The returned node must be of type **Control** or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When ``null`` or a non-Control node is returned, the default tooltip will be used instead.
  1435. The returned node will be added as child to a :ref:`PopupPanel<class_PopupPanel>`, so you should only provide the contents of that panel. That :ref:`PopupPanel<class_PopupPanel>` can be themed using :ref:`Theme.set_stylebox()<class_Theme_method_set_stylebox>` for the type ``"TooltipPanel"`` (see :ref:`tooltip_text<class_Control_property_tooltip_text>` for an example).
  1436. \ **Note:** The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>` to some non-zero value.
  1437. \ **Note:** The node (and any relevant children) should have their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` set to ``true`` when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably.
  1438. \ **Note:** If overridden, this method is called even if :ref:`get_tooltip()<class_Control_method_get_tooltip>` returns an empty string. When this happens with the default tooltip, it is not displayed. To copy this behavior, return ``null`` in this method when ``for_text`` is empty.
  1439. \ **Example:** Use a constructed node as a tooltip:
  1440. .. tabs::
  1441. .. code-tab:: gdscript
  1442. func _make_custom_tooltip(for_text):
  1443. var label = Label.new()
  1444. label.text = for_text
  1445. return label
  1446. .. code-tab:: csharp
  1447. public override Control _MakeCustomTooltip(string forText)
  1448. {
  1449. var label = new Label();
  1450. label.Text = forText;
  1451. return label;
  1452. }
  1453. \ **Example:** Usa a scene instance as a tooltip:
  1454. .. tabs::
  1455. .. code-tab:: gdscript
  1456. func _make_custom_tooltip(for_text):
  1457. var tooltip = preload("res://some_tooltip_scene.tscn").instantiate()
  1458. tooltip.get_node("Label").text = for_text
  1459. return tooltip
  1460. .. code-tab:: csharp
  1461. public override Control _MakeCustomTooltip(string forText)
  1462. {
  1463. Node tooltip = ResourceLoader.Load<PackedScene>("res://some_tooltip_scene.tscn").Instantiate();
  1464. tooltip.GetNode<Label>("Label").Text = forText;
  1465. return tooltip;
  1466. }
  1467. .. rst-class:: classref-item-separator
  1468. ----
  1469. .. _class_Control_private_method__structured_text_parser:
  1470. .. rst-class:: classref-method
  1471. :ref:`Array<class_Array>`\[:ref:`Vector3i<class_Vector3i>`\] **_structured_text_parser**\ (\ args\: :ref:`Array<class_Array>`, text\: :ref:`String<class_String>`\ ) |virtual| |const| :ref:`๐Ÿ”—<class_Control_private_method__structured_text_parser>`
  1472. User defined BiDi algorithm override function.
  1473. Returns an :ref:`Array<class_Array>` of :ref:`Vector3i<class_Vector3i>` text ranges and text base directions, in the left-to-right order. Ranges should cover full source ``text`` without overlaps. BiDi algorithm will be used on each range separately.
  1474. .. rst-class:: classref-item-separator
  1475. ----
  1476. .. _class_Control_method_accept_event:
  1477. .. rst-class:: classref-method
  1478. |void| **accept_event**\ (\ ) :ref:`๐Ÿ”—<class_Control_method_accept_event>`
  1479. Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to :ref:`Node._unhandled_input()<class_Node_private_method__unhandled_input>` or :ref:`Node._unhandled_key_input()<class_Node_private_method__unhandled_key_input>`.
  1480. \ **Note:** This does not affect the methods in :ref:`Input<class_Input>`, only the way events are propagated.
  1481. .. rst-class:: classref-item-separator
  1482. ----
  1483. .. _class_Control_method_accessibility_drag:
  1484. .. rst-class:: classref-method
  1485. |void| **accessibility_drag**\ (\ ) :ref:`๐Ÿ”—<class_Control_method_accessibility_drag>`
  1486. Starts drag-and-drop operation without using a mouse.
  1487. .. rst-class:: classref-item-separator
  1488. ----
  1489. .. _class_Control_method_accessibility_drop:
  1490. .. rst-class:: classref-method
  1491. |void| **accessibility_drop**\ (\ ) :ref:`๐Ÿ”—<class_Control_method_accessibility_drop>`
  1492. Ends drag-and-drop operation without using a mouse.
  1493. .. rst-class:: classref-item-separator
  1494. ----
  1495. .. _class_Control_method_add_theme_color_override:
  1496. .. rst-class:: classref-method
  1497. |void| **add_theme_color_override**\ (\ name\: :ref:`StringName<class_StringName>`, color\: :ref:`Color<class_Color>`\ ) :ref:`๐Ÿ”—<class_Control_method_add_theme_color_override>`
  1498. Creates a local override for a theme :ref:`Color<class_Color>` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_color_override()<class_Control_method_remove_theme_color_override>`.
  1499. See also :ref:`get_theme_color()<class_Control_method_get_theme_color>`.
  1500. \ **Example:** Override a :ref:`Label<class_Label>`'s color and reset it later:
  1501. .. tabs::
  1502. .. code-tab:: gdscript
  1503. # Given the child Label node "MyLabel", override its font color with a custom value.
  1504. $MyLabel.add_theme_color_override("font_color", Color(1, 0.5, 0))
  1505. # Reset the font color of the child label.
  1506. $MyLabel.remove_theme_color_override("font_color")
  1507. # Alternatively it can be overridden with the default value from the Label type.
  1508. $MyLabel.add_theme_color_override("font_color", get_theme_color("font_color", "Label"))
  1509. .. code-tab:: csharp
  1510. // Given the child Label node "MyLabel", override its font color with a custom value.
  1511. GetNode<Label>("MyLabel").AddThemeColorOverride("font_color", new Color(1, 0.5f, 0));
  1512. // Reset the font color of the child label.
  1513. GetNode<Label>("MyLabel").RemoveThemeColorOverride("font_color");
  1514. // Alternatively it can be overridden with the default value from the Label type.
  1515. GetNode<Label>("MyLabel").AddThemeColorOverride("font_color", GetThemeColor("font_color", "Label"));
  1516. .. rst-class:: classref-item-separator
  1517. ----
  1518. .. _class_Control_method_add_theme_constant_override:
  1519. .. rst-class:: classref-method
  1520. |void| **add_theme_constant_override**\ (\ name\: :ref:`StringName<class_StringName>`, constant\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Control_method_add_theme_constant_override>`
  1521. Creates a local override for a theme constant with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_constant_override()<class_Control_method_remove_theme_constant_override>`.
  1522. See also :ref:`get_theme_constant()<class_Control_method_get_theme_constant>`.
  1523. .. rst-class:: classref-item-separator
  1524. ----
  1525. .. _class_Control_method_add_theme_font_override:
  1526. .. rst-class:: classref-method
  1527. |void| **add_theme_font_override**\ (\ name\: :ref:`StringName<class_StringName>`, font\: :ref:`Font<class_Font>`\ ) :ref:`๐Ÿ”—<class_Control_method_add_theme_font_override>`
  1528. Creates a local override for a theme :ref:`Font<class_Font>` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_override()<class_Control_method_remove_theme_font_override>`.
  1529. See also :ref:`get_theme_font()<class_Control_method_get_theme_font>`.
  1530. .. rst-class:: classref-item-separator
  1531. ----
  1532. .. _class_Control_method_add_theme_font_size_override:
  1533. .. rst-class:: classref-method
  1534. |void| **add_theme_font_size_override**\ (\ name\: :ref:`StringName<class_StringName>`, font_size\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Control_method_add_theme_font_size_override>`
  1535. Creates a local override for a theme font size with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_size_override()<class_Control_method_remove_theme_font_size_override>`.
  1536. See also :ref:`get_theme_font_size()<class_Control_method_get_theme_font_size>`.
  1537. .. rst-class:: classref-item-separator
  1538. ----
  1539. .. _class_Control_method_add_theme_icon_override:
  1540. .. rst-class:: classref-method
  1541. |void| **add_theme_icon_override**\ (\ name\: :ref:`StringName<class_StringName>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`๐Ÿ”—<class_Control_method_add_theme_icon_override>`
  1542. Creates a local override for a theme icon with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_icon_override()<class_Control_method_remove_theme_icon_override>`.
  1543. See also :ref:`get_theme_icon()<class_Control_method_get_theme_icon>`.
  1544. .. rst-class:: classref-item-separator
  1545. ----
  1546. .. _class_Control_method_add_theme_stylebox_override:
  1547. .. rst-class:: classref-method
  1548. |void| **add_theme_stylebox_override**\ (\ name\: :ref:`StringName<class_StringName>`, stylebox\: :ref:`StyleBox<class_StyleBox>`\ ) :ref:`๐Ÿ”—<class_Control_method_add_theme_stylebox_override>`
  1549. Creates a local override for a theme :ref:`StyleBox<class_StyleBox>` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_stylebox_override()<class_Control_method_remove_theme_stylebox_override>`.
  1550. See also :ref:`get_theme_stylebox()<class_Control_method_get_theme_stylebox>`.
  1551. \ **Example:** Modify a property in a :ref:`StyleBox<class_StyleBox>` by duplicating it:
  1552. .. tabs::
  1553. .. code-tab:: gdscript
  1554. # The snippet below assumes the child node "MyButton" has a StyleBoxFlat assigned.
  1555. # Resources are shared across instances, so we need to duplicate it
  1556. # to avoid modifying the appearance of all other buttons.
  1557. var new_stylebox_normal = $MyButton.get_theme_stylebox("normal").duplicate()
  1558. new_stylebox_normal.border_width_top = 3
  1559. new_stylebox_normal.border_color = Color(0, 1, 0.5)
  1560. $MyButton.add_theme_stylebox_override("normal", new_stylebox_normal)
  1561. # Remove the stylebox override.
  1562. $MyButton.remove_theme_stylebox_override("normal")
  1563. .. code-tab:: csharp
  1564. // The snippet below assumes the child node "MyButton" has a StyleBoxFlat assigned.
  1565. // Resources are shared across instances, so we need to duplicate it
  1566. // to avoid modifying the appearance of all other buttons.
  1567. StyleBoxFlat newStyleboxNormal = GetNode<Button>("MyButton").GetThemeStylebox("normal").Duplicate() as StyleBoxFlat;
  1568. newStyleboxNormal.BorderWidthTop = 3;
  1569. newStyleboxNormal.BorderColor = new Color(0, 1, 0.5f);
  1570. GetNode<Button>("MyButton").AddThemeStyleboxOverride("normal", newStyleboxNormal);
  1571. // Remove the stylebox override.
  1572. GetNode<Button>("MyButton").RemoveThemeStyleboxOverride("normal");
  1573. .. rst-class:: classref-item-separator
  1574. ----
  1575. .. _class_Control_method_begin_bulk_theme_override:
  1576. .. rst-class:: classref-method
  1577. |void| **begin_bulk_theme_override**\ (\ ) :ref:`๐Ÿ”—<class_Control_method_begin_bulk_theme_override>`
  1578. Prevents ``*_theme_*_override`` methods from emitting :ref:`NOTIFICATION_THEME_CHANGED<class_Control_constant_NOTIFICATION_THEME_CHANGED>` until :ref:`end_bulk_theme_override()<class_Control_method_end_bulk_theme_override>` is called.
  1579. .. rst-class:: classref-item-separator
  1580. ----
  1581. .. _class_Control_method_end_bulk_theme_override:
  1582. .. rst-class:: classref-method
  1583. |void| **end_bulk_theme_override**\ (\ ) :ref:`๐Ÿ”—<class_Control_method_end_bulk_theme_override>`
  1584. Ends a bulk theme override update. See :ref:`begin_bulk_theme_override()<class_Control_method_begin_bulk_theme_override>`.
  1585. .. rst-class:: classref-item-separator
  1586. ----
  1587. .. _class_Control_method_find_next_valid_focus:
  1588. .. rst-class:: classref-method
  1589. :ref:`Control<class_Control>` **find_next_valid_focus**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_find_next_valid_focus>`
  1590. Finds the next (below in the tree) **Control** that can receive the focus.
  1591. .. rst-class:: classref-item-separator
  1592. ----
  1593. .. _class_Control_method_find_prev_valid_focus:
  1594. .. rst-class:: classref-method
  1595. :ref:`Control<class_Control>` **find_prev_valid_focus**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_find_prev_valid_focus>`
  1596. Finds the previous (above in the tree) **Control** that can receive the focus.
  1597. .. rst-class:: classref-item-separator
  1598. ----
  1599. .. _class_Control_method_find_valid_focus_neighbor:
  1600. .. rst-class:: classref-method
  1601. :ref:`Control<class_Control>` **find_valid_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`๐Ÿ”—<class_Control_method_find_valid_focus_neighbor>`
  1602. Finds the next **Control** that can receive the focus on the specified :ref:`Side<enum_@GlobalScope_Side>`.
  1603. \ **Note:** This is different from :ref:`get_focus_neighbor()<class_Control_method_get_focus_neighbor>`, which returns the path of a specified focus neighbor.
  1604. .. rst-class:: classref-item-separator
  1605. ----
  1606. .. _class_Control_method_force_drag:
  1607. .. rst-class:: classref-method
  1608. |void| **force_drag**\ (\ data\: :ref:`Variant<class_Variant>`, preview\: :ref:`Control<class_Control>`\ ) :ref:`๐Ÿ”—<class_Control_method_force_drag>`
  1609. Forces drag and bypasses :ref:`_get_drag_data()<class_Control_private_method__get_drag_data>` and :ref:`set_drag_preview()<class_Control_method_set_drag_preview>` by passing ``data`` and ``preview``. Drag will start even if the mouse is neither over nor pressed on this control.
  1610. The methods :ref:`_can_drop_data()<class_Control_private_method__can_drop_data>` and :ref:`_drop_data()<class_Control_private_method__drop_data>` must be implemented on controls that want to receive drop data.
  1611. .. rst-class:: classref-item-separator
  1612. ----
  1613. .. _class_Control_method_get_anchor:
  1614. .. rst-class:: classref-method
  1615. :ref:`float<class_float>` **get_anchor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_anchor>`
  1616. Returns the anchor for the specified :ref:`Side<enum_@GlobalScope_Side>`. A getter method for :ref:`anchor_bottom<class_Control_property_anchor_bottom>`, :ref:`anchor_left<class_Control_property_anchor_left>`, :ref:`anchor_right<class_Control_property_anchor_right>` and :ref:`anchor_top<class_Control_property_anchor_top>`.
  1617. .. rst-class:: classref-item-separator
  1618. ----
  1619. .. _class_Control_method_get_begin:
  1620. .. rst-class:: classref-method
  1621. :ref:`Vector2<class_Vector2>` **get_begin**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_begin>`
  1622. Returns :ref:`offset_left<class_Control_property_offset_left>` and :ref:`offset_top<class_Control_property_offset_top>`. See also :ref:`position<class_Control_property_position>`.
  1623. .. rst-class:: classref-item-separator
  1624. ----
  1625. .. _class_Control_method_get_combined_minimum_size:
  1626. .. rst-class:: classref-method
  1627. :ref:`Vector2<class_Vector2>` **get_combined_minimum_size**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_combined_minimum_size>`
  1628. Returns combined minimum size from :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>` and :ref:`get_minimum_size()<class_Control_method_get_minimum_size>`.
  1629. .. rst-class:: classref-item-separator
  1630. ----
  1631. .. _class_Control_method_get_cursor_shape:
  1632. .. rst-class:: classref-method
  1633. :ref:`CursorShape<enum_Control_CursorShape>` **get_cursor_shape**\ (\ position\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_cursor_shape>`
  1634. Returns the mouse cursor shape for this control when hovered over ``position`` in local coordinates. For most controls, this is the same as :ref:`mouse_default_cursor_shape<class_Control_property_mouse_default_cursor_shape>`, but some built-in controls implement more complex logic.
  1635. .. rst-class:: classref-item-separator
  1636. ----
  1637. .. _class_Control_method_get_end:
  1638. .. rst-class:: classref-method
  1639. :ref:`Vector2<class_Vector2>` **get_end**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_end>`
  1640. Returns :ref:`offset_right<class_Control_property_offset_right>` and :ref:`offset_bottom<class_Control_property_offset_bottom>`.
  1641. .. rst-class:: classref-item-separator
  1642. ----
  1643. .. _class_Control_method_get_focus_mode_with_override:
  1644. .. rst-class:: classref-method
  1645. :ref:`FocusMode<enum_Control_FocusMode>` **get_focus_mode_with_override**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_focus_mode_with_override>`
  1646. Returns the :ref:`focus_mode<class_Control_property_focus_mode>`, but takes the :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>` into account. If :ref:`focus_behavior_recursive<class_Control_property_focus_behavior_recursive>` is set to :ref:`FOCUS_BEHAVIOR_DISABLED<class_Control_constant_FOCUS_BEHAVIOR_DISABLED>`, or it is set to :ref:`FOCUS_BEHAVIOR_INHERITED<class_Control_constant_FOCUS_BEHAVIOR_INHERITED>` and its ancestor is set to :ref:`FOCUS_BEHAVIOR_DISABLED<class_Control_constant_FOCUS_BEHAVIOR_DISABLED>`, then this returns :ref:`FOCUS_NONE<class_Control_constant_FOCUS_NONE>`.
  1647. .. rst-class:: classref-item-separator
  1648. ----
  1649. .. _class_Control_method_get_focus_neighbor:
  1650. .. rst-class:: classref-method
  1651. :ref:`NodePath<class_NodePath>` **get_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_focus_neighbor>`
  1652. Returns the focus neighbor for the specified :ref:`Side<enum_@GlobalScope_Side>`. A getter method for :ref:`focus_neighbor_bottom<class_Control_property_focus_neighbor_bottom>`, :ref:`focus_neighbor_left<class_Control_property_focus_neighbor_left>`, :ref:`focus_neighbor_right<class_Control_property_focus_neighbor_right>` and :ref:`focus_neighbor_top<class_Control_property_focus_neighbor_top>`.
  1653. \ **Note:** To find the next **Control** on the specific :ref:`Side<enum_@GlobalScope_Side>`, even if a neighbor is not assigned, use :ref:`find_valid_focus_neighbor()<class_Control_method_find_valid_focus_neighbor>`.
  1654. .. rst-class:: classref-item-separator
  1655. ----
  1656. .. _class_Control_method_get_global_rect:
  1657. .. rst-class:: classref-method
  1658. :ref:`Rect2<class_Rect2>` **get_global_rect**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_global_rect>`
  1659. Returns the position and size of the control relative to the containing canvas. See :ref:`global_position<class_Control_property_global_position>` and :ref:`size<class_Control_property_size>`.
  1660. \ **Note:** If the node itself or any parent :ref:`CanvasItem<class_CanvasItem>` between the node and the canvas have a non default rotation or skew, the resulting size is likely not meaningful.
  1661. \ **Note:** Setting :ref:`Viewport.gui_snap_controls_to_pixels<class_Viewport_property_gui_snap_controls_to_pixels>` to ``true`` can lead to rounding inaccuracies between the displayed control and the returned :ref:`Rect2<class_Rect2>`.
  1662. .. rst-class:: classref-item-separator
  1663. ----
  1664. .. _class_Control_method_get_minimum_size:
  1665. .. rst-class:: classref-method
  1666. :ref:`Vector2<class_Vector2>` **get_minimum_size**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_minimum_size>`
  1667. Returns the minimum size for this control. See :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>`.
  1668. .. rst-class:: classref-item-separator
  1669. ----
  1670. .. _class_Control_method_get_mouse_filter_with_override:
  1671. .. rst-class:: classref-method
  1672. :ref:`MouseFilter<enum_Control_MouseFilter>` **get_mouse_filter_with_override**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_mouse_filter_with_override>`
  1673. Returns the :ref:`mouse_filter<class_Control_property_mouse_filter>`, but takes the :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>` into account. If :ref:`mouse_behavior_recursive<class_Control_property_mouse_behavior_recursive>` is set to :ref:`MOUSE_BEHAVIOR_DISABLED<class_Control_constant_MOUSE_BEHAVIOR_DISABLED>`, or it is set to :ref:`MOUSE_BEHAVIOR_INHERITED<class_Control_constant_MOUSE_BEHAVIOR_INHERITED>` and its ancestor is set to :ref:`MOUSE_BEHAVIOR_DISABLED<class_Control_constant_MOUSE_BEHAVIOR_DISABLED>`, then this returns :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>`.
  1674. .. rst-class:: classref-item-separator
  1675. ----
  1676. .. _class_Control_method_get_offset:
  1677. .. rst-class:: classref-method
  1678. :ref:`float<class_float>` **get_offset**\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_offset>`
  1679. Returns the offset for the specified :ref:`Side<enum_@GlobalScope_Side>`. A getter method for :ref:`offset_bottom<class_Control_property_offset_bottom>`, :ref:`offset_left<class_Control_property_offset_left>`, :ref:`offset_right<class_Control_property_offset_right>` and :ref:`offset_top<class_Control_property_offset_top>`.
  1680. .. rst-class:: classref-item-separator
  1681. ----
  1682. .. _class_Control_method_get_parent_area_size:
  1683. .. rst-class:: classref-method
  1684. :ref:`Vector2<class_Vector2>` **get_parent_area_size**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_parent_area_size>`
  1685. Returns the width/height occupied in the parent control.
  1686. .. rst-class:: classref-item-separator
  1687. ----
  1688. .. _class_Control_method_get_parent_control:
  1689. .. rst-class:: classref-method
  1690. :ref:`Control<class_Control>` **get_parent_control**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_parent_control>`
  1691. Returns the parent control node.
  1692. .. rst-class:: classref-item-separator
  1693. ----
  1694. .. _class_Control_method_get_rect:
  1695. .. rst-class:: classref-method
  1696. :ref:`Rect2<class_Rect2>` **get_rect**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_rect>`
  1697. Returns the position and size of the control in the coordinate system of the containing node. See :ref:`position<class_Control_property_position>`, :ref:`scale<class_Control_property_scale>` and :ref:`size<class_Control_property_size>`.
  1698. \ **Note:** If :ref:`rotation<class_Control_property_rotation>` is not the default rotation, the resulting size is not meaningful.
  1699. \ **Note:** Setting :ref:`Viewport.gui_snap_controls_to_pixels<class_Viewport_property_gui_snap_controls_to_pixels>` to ``true`` can lead to rounding inaccuracies between the displayed control and the returned :ref:`Rect2<class_Rect2>`.
  1700. .. rst-class:: classref-item-separator
  1701. ----
  1702. .. _class_Control_method_get_screen_position:
  1703. .. rst-class:: classref-method
  1704. :ref:`Vector2<class_Vector2>` **get_screen_position**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_screen_position>`
  1705. Returns the position of this **Control** in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.
  1706. Equals to :ref:`global_position<class_Control_property_global_position>` if the window is embedded (see :ref:`Viewport.gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>`).
  1707. \ **Example:** Show a popup at the mouse position:
  1708. ::
  1709. popup_menu.position = get_screen_position() + get_local_mouse_position()
  1710. popup_menu.reset_size()
  1711. popup_menu.popup()
  1712. .. rst-class:: classref-item-separator
  1713. ----
  1714. .. _class_Control_method_get_theme_color:
  1715. .. rst-class:: classref-method
  1716. :ref:`Color<class_Color>` **get_theme_color**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_theme_color>`
  1717. Returns a :ref:`Color<class_Color>` from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a color item with the specified ``name`` and ``theme_type``. If ``theme_type`` is omitted the class name of the current control is used as the type, or :ref:`theme_type_variation<class_Control_property_theme_type_variation>` if it is defined. If the type is a class name its parent classes are also checked, in order of inheritance. If the type is a variation its base types are checked, in order of dependency, then the control's class name and its parent classes are checked.
  1718. For the current control its local overrides are considered first (see :ref:`add_theme_color_override()<class_Control_method_add_theme_color_override>`), then its assigned :ref:`theme<class_Control_property_theme>`. After the current control, each parent control and its assigned :ref:`theme<class_Control_property_theme>` are considered; controls without a :ref:`theme<class_Control_property_theme>` assigned are skipped. If no matching :ref:`Theme<class_Theme>` is found in the tree, the custom project :ref:`Theme<class_Theme>` (see :ref:`ProjectSettings.gui/theme/custom<class_ProjectSettings_property_gui/theme/custom>`) and the default :ref:`Theme<class_Theme>` are used (see :ref:`ThemeDB<class_ThemeDB>`).
  1719. .. tabs::
  1720. .. code-tab:: gdscript
  1721. func _ready():
  1722. # Get the font color defined for the current Control's class, if it exists.
  1723. modulate = get_theme_color("font_color")
  1724. # Get the font color defined for the Button class.
  1725. modulate = get_theme_color("font_color", "Button")
  1726. .. code-tab:: csharp
  1727. public override void _Ready()
  1728. {
  1729. // Get the font color defined for the current Control's class, if it exists.
  1730. Modulate = GetThemeColor("font_color");
  1731. // Get the font color defined for the Button class.
  1732. Modulate = GetThemeColor("font_color", "Button");
  1733. }
  1734. .. rst-class:: classref-item-separator
  1735. ----
  1736. .. _class_Control_method_get_theme_constant:
  1737. .. rst-class:: classref-method
  1738. :ref:`int<class_int>` **get_theme_constant**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_theme_constant>`
  1739. Returns a constant from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a constant item with the specified ``name`` and ``theme_type``.
  1740. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1741. .. rst-class:: classref-item-separator
  1742. ----
  1743. .. _class_Control_method_get_theme_default_base_scale:
  1744. .. rst-class:: classref-method
  1745. :ref:`float<class_float>` **get_theme_default_base_scale**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_theme_default_base_scale>`
  1746. Returns the default base scale value from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a valid :ref:`Theme.default_base_scale<class_Theme_property_default_base_scale>` value.
  1747. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1748. .. rst-class:: classref-item-separator
  1749. ----
  1750. .. _class_Control_method_get_theme_default_font:
  1751. .. rst-class:: classref-method
  1752. :ref:`Font<class_Font>` **get_theme_default_font**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_theme_default_font>`
  1753. Returns the default font from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a valid :ref:`Theme.default_font<class_Theme_property_default_font>` value.
  1754. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1755. .. rst-class:: classref-item-separator
  1756. ----
  1757. .. _class_Control_method_get_theme_default_font_size:
  1758. .. rst-class:: classref-method
  1759. :ref:`int<class_int>` **get_theme_default_font_size**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_theme_default_font_size>`
  1760. Returns the default font size value from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a valid :ref:`Theme.default_font_size<class_Theme_property_default_font_size>` value.
  1761. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1762. .. rst-class:: classref-item-separator
  1763. ----
  1764. .. _class_Control_method_get_theme_font:
  1765. .. rst-class:: classref-method
  1766. :ref:`Font<class_Font>` **get_theme_font**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_theme_font>`
  1767. Returns a :ref:`Font<class_Font>` from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a font item with the specified ``name`` and ``theme_type``.
  1768. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1769. .. rst-class:: classref-item-separator
  1770. ----
  1771. .. _class_Control_method_get_theme_font_size:
  1772. .. rst-class:: classref-method
  1773. :ref:`int<class_int>` **get_theme_font_size**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_theme_font_size>`
  1774. Returns a font size from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a font size item with the specified ``name`` and ``theme_type``.
  1775. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1776. .. rst-class:: classref-item-separator
  1777. ----
  1778. .. _class_Control_method_get_theme_icon:
  1779. .. rst-class:: classref-method
  1780. :ref:`Texture2D<class_Texture2D>` **get_theme_icon**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_theme_icon>`
  1781. Returns an icon from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has an icon item with the specified ``name`` and ``theme_type``.
  1782. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1783. .. rst-class:: classref-item-separator
  1784. ----
  1785. .. _class_Control_method_get_theme_stylebox:
  1786. .. rst-class:: classref-method
  1787. :ref:`StyleBox<class_StyleBox>` **get_theme_stylebox**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_theme_stylebox>`
  1788. Returns a :ref:`StyleBox<class_StyleBox>` from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a stylebox item with the specified ``name`` and ``theme_type``.
  1789. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1790. .. rst-class:: classref-item-separator
  1791. ----
  1792. .. _class_Control_method_get_tooltip:
  1793. .. rst-class:: classref-method
  1794. :ref:`String<class_String>` **get_tooltip**\ (\ at_position\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) |const| :ref:`๐Ÿ”—<class_Control_method_get_tooltip>`
  1795. Returns the tooltip text for the position ``at_position`` in control's local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns :ref:`tooltip_text<class_Control_property_tooltip_text>`.
  1796. This method can be overridden to customize its behavior. See :ref:`_get_tooltip()<class_Control_private_method__get_tooltip>`.
  1797. \ **Note:** If this method returns an empty :ref:`String<class_String>` and :ref:`_make_custom_tooltip()<class_Control_private_method__make_custom_tooltip>` is not overridden, no tooltip is displayed.
  1798. .. rst-class:: classref-item-separator
  1799. ----
  1800. .. _class_Control_method_grab_click_focus:
  1801. .. rst-class:: classref-method
  1802. |void| **grab_click_focus**\ (\ ) :ref:`๐Ÿ”—<class_Control_method_grab_click_focus>`
  1803. Creates an :ref:`InputEventMouseButton<class_InputEventMouseButton>` that attempts to click the control. If the event is received, the control gains focus.
  1804. .. tabs::
  1805. .. code-tab:: gdscript
  1806. func _process(delta):
  1807. grab_click_focus() # When clicking another Control node, this node will be clicked instead.
  1808. .. code-tab:: csharp
  1809. public override void _Process(double delta)
  1810. {
  1811. GrabClickFocus(); // When clicking another Control node, this node will be clicked instead.
  1812. }
  1813. .. rst-class:: classref-item-separator
  1814. ----
  1815. .. _class_Control_method_grab_focus:
  1816. .. rst-class:: classref-method
  1817. |void| **grab_focus**\ (\ ) :ref:`๐Ÿ”—<class_Control_method_grab_focus>`
  1818. Steal the focus from another control and become the focused control (see :ref:`focus_mode<class_Control_property_focus_mode>`).
  1819. \ **Note:** Using this method together with :ref:`Callable.call_deferred()<class_Callable_method_call_deferred>` makes it more reliable, especially when called inside :ref:`Node._ready()<class_Node_private_method__ready>`.
  1820. .. rst-class:: classref-item-separator
  1821. ----
  1822. .. _class_Control_method_has_focus:
  1823. .. rst-class:: classref-method
  1824. :ref:`bool<class_bool>` **has_focus**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_focus>`
  1825. Returns ``true`` if this is the current focused control. See :ref:`focus_mode<class_Control_property_focus_mode>`.
  1826. .. rst-class:: classref-item-separator
  1827. ----
  1828. .. _class_Control_method_has_theme_color:
  1829. .. rst-class:: classref-method
  1830. :ref:`bool<class_bool>` **has_theme_color**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_color>`
  1831. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has a color item with the specified ``name`` and ``theme_type``.
  1832. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1833. .. rst-class:: classref-item-separator
  1834. ----
  1835. .. _class_Control_method_has_theme_color_override:
  1836. .. rst-class:: classref-method
  1837. :ref:`bool<class_bool>` **has_theme_color_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_color_override>`
  1838. Returns ``true`` if there is a local override for a theme :ref:`Color<class_Color>` with the specified ``name`` in this **Control** node.
  1839. See :ref:`add_theme_color_override()<class_Control_method_add_theme_color_override>`.
  1840. .. rst-class:: classref-item-separator
  1841. ----
  1842. .. _class_Control_method_has_theme_constant:
  1843. .. rst-class:: classref-method
  1844. :ref:`bool<class_bool>` **has_theme_constant**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_constant>`
  1845. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has a constant item with the specified ``name`` and ``theme_type``.
  1846. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1847. .. rst-class:: classref-item-separator
  1848. ----
  1849. .. _class_Control_method_has_theme_constant_override:
  1850. .. rst-class:: classref-method
  1851. :ref:`bool<class_bool>` **has_theme_constant_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_constant_override>`
  1852. Returns ``true`` if there is a local override for a theme constant with the specified ``name`` in this **Control** node.
  1853. See :ref:`add_theme_constant_override()<class_Control_method_add_theme_constant_override>`.
  1854. .. rst-class:: classref-item-separator
  1855. ----
  1856. .. _class_Control_method_has_theme_font:
  1857. .. rst-class:: classref-method
  1858. :ref:`bool<class_bool>` **has_theme_font**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_font>`
  1859. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has a font item with the specified ``name`` and ``theme_type``.
  1860. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1861. .. rst-class:: classref-item-separator
  1862. ----
  1863. .. _class_Control_method_has_theme_font_override:
  1864. .. rst-class:: classref-method
  1865. :ref:`bool<class_bool>` **has_theme_font_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_font_override>`
  1866. Returns ``true`` if there is a local override for a theme :ref:`Font<class_Font>` with the specified ``name`` in this **Control** node.
  1867. See :ref:`add_theme_font_override()<class_Control_method_add_theme_font_override>`.
  1868. .. rst-class:: classref-item-separator
  1869. ----
  1870. .. _class_Control_method_has_theme_font_size:
  1871. .. rst-class:: classref-method
  1872. :ref:`bool<class_bool>` **has_theme_font_size**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_font_size>`
  1873. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has a font size item with the specified ``name`` and ``theme_type``.
  1874. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1875. .. rst-class:: classref-item-separator
  1876. ----
  1877. .. _class_Control_method_has_theme_font_size_override:
  1878. .. rst-class:: classref-method
  1879. :ref:`bool<class_bool>` **has_theme_font_size_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_font_size_override>`
  1880. Returns ``true`` if there is a local override for a theme font size with the specified ``name`` in this **Control** node.
  1881. See :ref:`add_theme_font_size_override()<class_Control_method_add_theme_font_size_override>`.
  1882. .. rst-class:: classref-item-separator
  1883. ----
  1884. .. _class_Control_method_has_theme_icon:
  1885. .. rst-class:: classref-method
  1886. :ref:`bool<class_bool>` **has_theme_icon**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_icon>`
  1887. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has an icon item with the specified ``name`` and ``theme_type``.
  1888. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1889. .. rst-class:: classref-item-separator
  1890. ----
  1891. .. _class_Control_method_has_theme_icon_override:
  1892. .. rst-class:: classref-method
  1893. :ref:`bool<class_bool>` **has_theme_icon_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_icon_override>`
  1894. Returns ``true`` if there is a local override for a theme icon with the specified ``name`` in this **Control** node.
  1895. See :ref:`add_theme_icon_override()<class_Control_method_add_theme_icon_override>`.
  1896. .. rst-class:: classref-item-separator
  1897. ----
  1898. .. _class_Control_method_has_theme_stylebox:
  1899. .. rst-class:: classref-method
  1900. :ref:`bool<class_bool>` **has_theme_stylebox**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_stylebox>`
  1901. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has a stylebox item with the specified ``name`` and ``theme_type``.
  1902. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1903. .. rst-class:: classref-item-separator
  1904. ----
  1905. .. _class_Control_method_has_theme_stylebox_override:
  1906. .. rst-class:: classref-method
  1907. :ref:`bool<class_bool>` **has_theme_stylebox_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`๐Ÿ”—<class_Control_method_has_theme_stylebox_override>`
  1908. Returns ``true`` if there is a local override for a theme :ref:`StyleBox<class_StyleBox>` with the specified ``name`` in this **Control** node.
  1909. See :ref:`add_theme_stylebox_override()<class_Control_method_add_theme_stylebox_override>`.
  1910. .. rst-class:: classref-item-separator
  1911. ----
  1912. .. _class_Control_method_is_drag_successful:
  1913. .. rst-class:: classref-method
  1914. :ref:`bool<class_bool>` **is_drag_successful**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_is_drag_successful>`
  1915. Returns ``true`` if a drag operation is successful. Alternative to :ref:`Viewport.gui_is_drag_successful()<class_Viewport_method_gui_is_drag_successful>`.
  1916. Best used with :ref:`Node.NOTIFICATION_DRAG_END<class_Node_constant_NOTIFICATION_DRAG_END>`.
  1917. .. rst-class:: classref-item-separator
  1918. ----
  1919. .. _class_Control_method_is_layout_rtl:
  1920. .. rst-class:: classref-method
  1921. :ref:`bool<class_bool>` **is_layout_rtl**\ (\ ) |const| :ref:`๐Ÿ”—<class_Control_method_is_layout_rtl>`
  1922. Returns ``true`` if the layout is right-to-left. See also :ref:`layout_direction<class_Control_property_layout_direction>`.
  1923. .. rst-class:: classref-item-separator
  1924. ----
  1925. .. _class_Control_method_release_focus:
  1926. .. rst-class:: classref-method
  1927. |void| **release_focus**\ (\ ) :ref:`๐Ÿ”—<class_Control_method_release_focus>`
  1928. Give up the focus. No other control will be able to receive input.
  1929. .. rst-class:: classref-item-separator
  1930. ----
  1931. .. _class_Control_method_remove_theme_color_override:
  1932. .. rst-class:: classref-method
  1933. |void| **remove_theme_color_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_Control_method_remove_theme_color_override>`
  1934. Removes a local override for a theme :ref:`Color<class_Color>` with the specified ``name`` previously added by :ref:`add_theme_color_override()<class_Control_method_add_theme_color_override>` or via the Inspector dock.
  1935. .. rst-class:: classref-item-separator
  1936. ----
  1937. .. _class_Control_method_remove_theme_constant_override:
  1938. .. rst-class:: classref-method
  1939. |void| **remove_theme_constant_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_Control_method_remove_theme_constant_override>`
  1940. Removes a local override for a theme constant with the specified ``name`` previously added by :ref:`add_theme_constant_override()<class_Control_method_add_theme_constant_override>` or via the Inspector dock.
  1941. .. rst-class:: classref-item-separator
  1942. ----
  1943. .. _class_Control_method_remove_theme_font_override:
  1944. .. rst-class:: classref-method
  1945. |void| **remove_theme_font_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_Control_method_remove_theme_font_override>`
  1946. Removes a local override for a theme :ref:`Font<class_Font>` with the specified ``name`` previously added by :ref:`add_theme_font_override()<class_Control_method_add_theme_font_override>` or via the Inspector dock.
  1947. .. rst-class:: classref-item-separator
  1948. ----
  1949. .. _class_Control_method_remove_theme_font_size_override:
  1950. .. rst-class:: classref-method
  1951. |void| **remove_theme_font_size_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_Control_method_remove_theme_font_size_override>`
  1952. Removes a local override for a theme font size with the specified ``name`` previously added by :ref:`add_theme_font_size_override()<class_Control_method_add_theme_font_size_override>` or via the Inspector dock.
  1953. .. rst-class:: classref-item-separator
  1954. ----
  1955. .. _class_Control_method_remove_theme_icon_override:
  1956. .. rst-class:: classref-method
  1957. |void| **remove_theme_icon_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_Control_method_remove_theme_icon_override>`
  1958. Removes a local override for a theme icon with the specified ``name`` previously added by :ref:`add_theme_icon_override()<class_Control_method_add_theme_icon_override>` or via the Inspector dock.
  1959. .. rst-class:: classref-item-separator
  1960. ----
  1961. .. _class_Control_method_remove_theme_stylebox_override:
  1962. .. rst-class:: classref-method
  1963. |void| **remove_theme_stylebox_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_Control_method_remove_theme_stylebox_override>`
  1964. Removes a local override for a theme :ref:`StyleBox<class_StyleBox>` with the specified ``name`` previously added by :ref:`add_theme_stylebox_override()<class_Control_method_add_theme_stylebox_override>` or via the Inspector dock.
  1965. .. rst-class:: classref-item-separator
  1966. ----
  1967. .. _class_Control_method_reset_size:
  1968. .. rst-class:: classref-method
  1969. |void| **reset_size**\ (\ ) :ref:`๐Ÿ”—<class_Control_method_reset_size>`
  1970. Resets the size to :ref:`get_combined_minimum_size()<class_Control_method_get_combined_minimum_size>`. This is equivalent to calling ``set_size(Vector2())`` (or any size below the minimum).
  1971. .. rst-class:: classref-item-separator
  1972. ----
  1973. .. _class_Control_method_set_anchor:
  1974. .. rst-class:: classref-method
  1975. |void| **set_anchor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, anchor\: :ref:`float<class_float>`, keep_offset\: :ref:`bool<class_bool>` = false, push_opposite_anchor\: :ref:`bool<class_bool>` = true\ ) :ref:`๐Ÿ”—<class_Control_method_set_anchor>`
  1976. Sets the anchor for the specified :ref:`Side<enum_@GlobalScope_Side>` to ``anchor``. A setter method for :ref:`anchor_bottom<class_Control_property_anchor_bottom>`, :ref:`anchor_left<class_Control_property_anchor_left>`, :ref:`anchor_right<class_Control_property_anchor_right>` and :ref:`anchor_top<class_Control_property_anchor_top>`.
  1977. If ``keep_offset`` is ``true``, offsets aren't updated after this operation.
  1978. If ``push_opposite_anchor`` is ``true`` and the opposite anchor overlaps this anchor, the opposite one will have its value overridden. For example, when setting left anchor to 1 and the right anchor has value of 0.5, the right anchor will also get value of 1. If ``push_opposite_anchor`` was ``false``, the left anchor would get value 0.5.
  1979. .. rst-class:: classref-item-separator
  1980. ----
  1981. .. _class_Control_method_set_anchor_and_offset:
  1982. .. rst-class:: classref-method
  1983. |void| **set_anchor_and_offset**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, anchor\: :ref:`float<class_float>`, offset\: :ref:`float<class_float>`, push_opposite_anchor\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_Control_method_set_anchor_and_offset>`
  1984. Works the same as :ref:`set_anchor()<class_Control_method_set_anchor>`, but instead of ``keep_offset`` argument and automatic update of offset, it allows to set the offset yourself (see :ref:`set_offset()<class_Control_method_set_offset>`).
  1985. .. rst-class:: classref-item-separator
  1986. ----
  1987. .. _class_Control_method_set_anchors_and_offsets_preset:
  1988. .. rst-class:: classref-method
  1989. |void| **set_anchors_and_offsets_preset**\ (\ preset\: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, resize_mode\: :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` = 0, margin\: :ref:`int<class_int>` = 0\ ) :ref:`๐Ÿ”—<class_Control_method_set_anchors_and_offsets_preset>`
  1990. Sets both anchor preset and offset preset. See :ref:`set_anchors_preset()<class_Control_method_set_anchors_preset>` and :ref:`set_offsets_preset()<class_Control_method_set_offsets_preset>`.
  1991. .. rst-class:: classref-item-separator
  1992. ----
  1993. .. _class_Control_method_set_anchors_preset:
  1994. .. rst-class:: classref-method
  1995. |void| **set_anchors_preset**\ (\ preset\: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_Control_method_set_anchors_preset>`
  1996. Sets the anchors to a ``preset`` from :ref:`LayoutPreset<enum_Control_LayoutPreset>` enum. This is the code equivalent to using the Layout menu in the 2D editor.
  1997. If ``keep_offsets`` is ``true``, control's position will also be updated.
  1998. .. rst-class:: classref-item-separator
  1999. ----
  2000. .. _class_Control_method_set_begin:
  2001. .. rst-class:: classref-method
  2002. |void| **set_begin**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`๐Ÿ”—<class_Control_method_set_begin>`
  2003. Sets :ref:`offset_left<class_Control_property_offset_left>` and :ref:`offset_top<class_Control_property_offset_top>` at the same time. Equivalent of changing :ref:`position<class_Control_property_position>`.
  2004. .. rst-class:: classref-item-separator
  2005. ----
  2006. .. _class_Control_method_set_drag_forwarding:
  2007. .. rst-class:: classref-method
  2008. |void| **set_drag_forwarding**\ (\ drag_func\: :ref:`Callable<class_Callable>`, can_drop_func\: :ref:`Callable<class_Callable>`, drop_func\: :ref:`Callable<class_Callable>`\ ) :ref:`๐Ÿ”—<class_Control_method_set_drag_forwarding>`
  2009. Sets the given callables to be used instead of the control's own drag-and-drop virtual methods. If a callable is empty, its respective virtual method is used as normal.
  2010. The arguments for each callable should be exactly the same as their respective virtual methods, which would be:
  2011. - ``drag_func`` corresponds to :ref:`_get_drag_data()<class_Control_private_method__get_drag_data>` and requires a :ref:`Vector2<class_Vector2>`;
  2012. - ``can_drop_func`` corresponds to :ref:`_can_drop_data()<class_Control_private_method__can_drop_data>` and requires both a :ref:`Vector2<class_Vector2>` and a :ref:`Variant<class_Variant>`;
  2013. - ``drop_func`` corresponds to :ref:`_drop_data()<class_Control_private_method__drop_data>` and requires both a :ref:`Vector2<class_Vector2>` and a :ref:`Variant<class_Variant>`.
  2014. .. rst-class:: classref-item-separator
  2015. ----
  2016. .. _class_Control_method_set_drag_preview:
  2017. .. rst-class:: classref-method
  2018. |void| **set_drag_preview**\ (\ control\: :ref:`Control<class_Control>`\ ) :ref:`๐Ÿ”—<class_Control_method_set_drag_preview>`
  2019. Shows the given control at the mouse pointer. A good time to call this method is in :ref:`_get_drag_data()<class_Control_private_method__get_drag_data>`. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended.
  2020. .. tabs::
  2021. .. code-tab:: gdscript
  2022. @export var color = Color(1, 0, 0, 1)
  2023. func _get_drag_data(position):
  2024. # Use a control that is not in the tree
  2025. var cpb = ColorPickerButton.new()
  2026. cpb.color = color
  2027. cpb.size = Vector2(50, 50)
  2028. set_drag_preview(cpb)
  2029. return color
  2030. .. code-tab:: csharp
  2031. [Export]
  2032. private Color _color = new Color(1, 0, 0, 1);
  2033. public override Variant _GetDragData(Vector2 atPosition)
  2034. {
  2035. // Use a control that is not in the tree
  2036. var cpb = new ColorPickerButton();
  2037. cpb.Color = _color;
  2038. cpb.Size = new Vector2(50, 50);
  2039. SetDragPreview(cpb);
  2040. return _color;
  2041. }
  2042. .. rst-class:: classref-item-separator
  2043. ----
  2044. .. _class_Control_method_set_end:
  2045. .. rst-class:: classref-method
  2046. |void| **set_end**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`๐Ÿ”—<class_Control_method_set_end>`
  2047. Sets :ref:`offset_right<class_Control_property_offset_right>` and :ref:`offset_bottom<class_Control_property_offset_bottom>` at the same time.
  2048. .. rst-class:: classref-item-separator
  2049. ----
  2050. .. _class_Control_method_set_focus_neighbor:
  2051. .. rst-class:: classref-method
  2052. |void| **set_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ ) :ref:`๐Ÿ”—<class_Control_method_set_focus_neighbor>`
  2053. Sets the focus neighbor for the specified :ref:`Side<enum_@GlobalScope_Side>` to the **Control** at ``neighbor`` node path. A setter method for :ref:`focus_neighbor_bottom<class_Control_property_focus_neighbor_bottom>`, :ref:`focus_neighbor_left<class_Control_property_focus_neighbor_left>`, :ref:`focus_neighbor_right<class_Control_property_focus_neighbor_right>` and :ref:`focus_neighbor_top<class_Control_property_focus_neighbor_top>`.
  2054. .. rst-class:: classref-item-separator
  2055. ----
  2056. .. _class_Control_method_set_global_position:
  2057. .. rst-class:: classref-method
  2058. |void| **set_global_position**\ (\ position\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_Control_method_set_global_position>`
  2059. Sets the :ref:`global_position<class_Control_property_global_position>` to given ``position``.
  2060. If ``keep_offsets`` is ``true``, control's anchors will be updated instead of offsets.
  2061. .. rst-class:: classref-item-separator
  2062. ----
  2063. .. _class_Control_method_set_offset:
  2064. .. rst-class:: classref-method
  2065. |void| **set_offset**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ ) :ref:`๐Ÿ”—<class_Control_method_set_offset>`
  2066. Sets the offset for the specified :ref:`Side<enum_@GlobalScope_Side>` to ``offset``. A setter method for :ref:`offset_bottom<class_Control_property_offset_bottom>`, :ref:`offset_left<class_Control_property_offset_left>`, :ref:`offset_right<class_Control_property_offset_right>` and :ref:`offset_top<class_Control_property_offset_top>`.
  2067. .. rst-class:: classref-item-separator
  2068. ----
  2069. .. _class_Control_method_set_offsets_preset:
  2070. .. rst-class:: classref-method
  2071. |void| **set_offsets_preset**\ (\ preset\: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, resize_mode\: :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` = 0, margin\: :ref:`int<class_int>` = 0\ ) :ref:`๐Ÿ”—<class_Control_method_set_offsets_preset>`
  2072. Sets the offsets to a ``preset`` from :ref:`LayoutPreset<enum_Control_LayoutPreset>` enum. This is the code equivalent to using the Layout menu in the 2D editor.
  2073. Use parameter ``resize_mode`` with constants from :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` to better determine the resulting size of the **Control**. Constant size will be ignored if used with presets that change size, e.g. :ref:`PRESET_LEFT_WIDE<class_Control_constant_PRESET_LEFT_WIDE>`.
  2074. Use parameter ``margin`` to determine the gap between the **Control** and the edges.
  2075. .. rst-class:: classref-item-separator
  2076. ----
  2077. .. _class_Control_method_set_position:
  2078. .. rst-class:: classref-method
  2079. |void| **set_position**\ (\ position\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_Control_method_set_position>`
  2080. Sets the :ref:`position<class_Control_property_position>` to given ``position``.
  2081. If ``keep_offsets`` is ``true``, control's anchors will be updated instead of offsets.
  2082. .. rst-class:: classref-item-separator
  2083. ----
  2084. .. _class_Control_method_set_size:
  2085. .. rst-class:: classref-method
  2086. |void| **set_size**\ (\ size\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_Control_method_set_size>`
  2087. Sets the size (see :ref:`size<class_Control_property_size>`).
  2088. If ``keep_offsets`` is ``true``, control's anchors will be updated instead of offsets.
  2089. .. rst-class:: classref-item-separator
  2090. ----
  2091. .. _class_Control_method_update_minimum_size:
  2092. .. rst-class:: classref-method
  2093. |void| **update_minimum_size**\ (\ ) :ref:`๐Ÿ”—<class_Control_method_update_minimum_size>`
  2094. Invalidates the size cache in this node and in parent nodes up to top level. Intended to be used with :ref:`get_minimum_size()<class_Control_method_get_minimum_size>` when the return value is changed. Setting :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>` directly calls this method automatically.
  2095. .. rst-class:: classref-item-separator
  2096. ----
  2097. .. _class_Control_method_warp_mouse:
  2098. .. rst-class:: classref-method
  2099. |void| **warp_mouse**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`๐Ÿ”—<class_Control_method_warp_mouse>`
  2100. Moves the mouse cursor to ``position``, relative to :ref:`position<class_Control_property_position>` of this **Control**.
  2101. \ **Note:** :ref:`warp_mouse()<class_Control_method_warp_mouse>` is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.
  2102. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  2103. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  2104. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  2105. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  2106. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  2107. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  2108. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  2109. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  2110. .. |void| replace:: :abbr:`void (No return value.)`