class_control.rst 240 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824
  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. Focus will not be represented visually if gained via mouse/touch input, only appearing with keyboard/gamepad input (for accessibility), or via :ref:`grab_focus()<class_Control_method_grab_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:`pivot_offset_ratio<class_Control_property_pivot_offset_ratio>` | ``Vector2(0, 0)`` |
  115. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  116. | :ref:`Vector2<class_Vector2>` | :ref:`position<class_Control_property_position>` | ``Vector2(0, 0)`` |
  117. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  118. | :ref:`float<class_float>` | :ref:`rotation<class_Control_property_rotation>` | ``0.0`` |
  119. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  120. | :ref:`float<class_float>` | :ref:`rotation_degrees<class_Control_property_rotation_degrees>` | |
  121. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  122. | :ref:`Vector2<class_Vector2>` | :ref:`scale<class_Control_property_scale>` | ``Vector2(1, 1)`` |
  123. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  124. | :ref:`Node<class_Node>` | :ref:`shortcut_context<class_Control_property_shortcut_context>` | |
  125. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  126. | :ref:`Vector2<class_Vector2>` | :ref:`size<class_Control_property_size>` | ``Vector2(0, 0)`` |
  127. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  128. | |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] | :ref:`size_flags_horizontal<class_Control_property_size_flags_horizontal>` | ``1`` |
  129. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  130. | :ref:`float<class_float>` | :ref:`size_flags_stretch_ratio<class_Control_property_size_flags_stretch_ratio>` | ``1.0`` |
  131. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  132. | |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] | :ref:`size_flags_vertical<class_Control_property_size_flags_vertical>` | ``1`` |
  133. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  134. | :ref:`Theme<class_Theme>` | :ref:`theme<class_Control_property_theme>` | |
  135. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  136. | :ref:`StringName<class_StringName>` | :ref:`theme_type_variation<class_Control_property_theme_type_variation>` | ``&""`` |
  137. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  138. | :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` | :ref:`tooltip_auto_translate_mode<class_Control_property_tooltip_auto_translate_mode>` | ``0`` |
  139. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  140. | :ref:`String<class_String>` | :ref:`tooltip_text<class_Control_property_tooltip_text>` | ``""`` |
  141. +------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  142. .. rst-class:: classref-reftable-group
  143. Methods
  144. -------
  145. .. table::
  146. :widths: auto
  147. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`String<class_String>` | :ref:`_accessibility_get_contextual_info<class_Control_private_method__accessibility_get_contextual_info>`\ (\ ) |virtual| |const| |
  149. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | :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| |
  151. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | |void| | :ref:`_drop_data<class_Control_private_method__drop_data>`\ (\ at_position\: :ref:`Vector2<class_Vector2>`, data\: :ref:`Variant<class_Variant>`\ ) |virtual| |
  153. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`String<class_String>` | :ref:`_get_accessibility_container_name<class_Control_private_method__get_accessibility_container_name>`\ (\ node\: :ref:`Node<class_Node>`\ ) |virtual| |const| |
  155. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`Variant<class_Variant>` | :ref:`_get_drag_data<class_Control_private_method__get_drag_data>`\ (\ at_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |
  157. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`Vector2<class_Vector2>` | :ref:`_get_minimum_size<class_Control_private_method__get_minimum_size>`\ (\ ) |virtual| |const| |
  159. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`String<class_String>` | :ref:`_get_tooltip<class_Control_private_method__get_tooltip>`\ (\ at_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |const| |
  161. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | |void| | :ref:`_gui_input<class_Control_private_method__gui_input>`\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual| |
  163. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`bool<class_bool>` | :ref:`_has_point<class_Control_private_method__has_point>`\ (\ point\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |const| |
  165. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`Object<class_Object>` | :ref:`_make_custom_tooltip<class_Control_private_method__make_custom_tooltip>`\ (\ for_text\: :ref:`String<class_String>`\ ) |virtual| |const| |
  167. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :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| |
  169. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | |void| | :ref:`accept_event<class_Control_method_accept_event>`\ (\ ) |
  171. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | |void| | :ref:`accessibility_drag<class_Control_method_accessibility_drag>`\ (\ ) |
  173. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | |void| | :ref:`accessibility_drop<class_Control_method_accessibility_drop>`\ (\ ) |
  175. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | |void| | :ref:`add_theme_color_override<class_Control_method_add_theme_color_override>`\ (\ name\: :ref:`StringName<class_StringName>`, color\: :ref:`Color<class_Color>`\ ) |
  177. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | |void| | :ref:`add_theme_constant_override<class_Control_method_add_theme_constant_override>`\ (\ name\: :ref:`StringName<class_StringName>`, constant\: :ref:`int<class_int>`\ ) |
  179. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | |void| | :ref:`add_theme_font_override<class_Control_method_add_theme_font_override>`\ (\ name\: :ref:`StringName<class_StringName>`, font\: :ref:`Font<class_Font>`\ ) |
  181. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | |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>`\ ) |
  183. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | |void| | :ref:`add_theme_icon_override<class_Control_method_add_theme_icon_override>`\ (\ name\: :ref:`StringName<class_StringName>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) |
  185. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | |void| | :ref:`add_theme_stylebox_override<class_Control_method_add_theme_stylebox_override>`\ (\ name\: :ref:`StringName<class_StringName>`, stylebox\: :ref:`StyleBox<class_StyleBox>`\ ) |
  187. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | |void| | :ref:`begin_bulk_theme_override<class_Control_method_begin_bulk_theme_override>`\ (\ ) |
  189. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | |void| | :ref:`end_bulk_theme_override<class_Control_method_end_bulk_theme_override>`\ (\ ) |
  191. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`Control<class_Control>` | :ref:`find_next_valid_focus<class_Control_method_find_next_valid_focus>`\ (\ ) |const| |
  193. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | :ref:`Control<class_Control>` | :ref:`find_prev_valid_focus<class_Control_method_find_prev_valid_focus>`\ (\ ) |const| |
  195. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | :ref:`Control<class_Control>` | :ref:`find_valid_focus_neighbor<class_Control_method_find_valid_focus_neighbor>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
  197. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | |void| | :ref:`force_drag<class_Control_method_force_drag>`\ (\ data\: :ref:`Variant<class_Variant>`, preview\: :ref:`Control<class_Control>`\ ) |
  199. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`float<class_float>` | :ref:`get_anchor<class_Control_method_get_anchor>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
  201. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | :ref:`Vector2<class_Vector2>` | :ref:`get_begin<class_Control_method_get_begin>`\ (\ ) |const| |
  203. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | :ref:`Vector2<class_Vector2>` | :ref:`get_combined_minimum_size<class_Control_method_get_combined_minimum_size>`\ (\ ) |const| |
  205. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | :ref:`Vector2<class_Vector2>` | :ref:`get_combined_pivot_offset<class_Control_method_get_combined_pivot_offset>`\ (\ ) |const| |
  207. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | :ref:`CursorShape<enum_Control_CursorShape>` | :ref:`get_cursor_shape<class_Control_method_get_cursor_shape>`\ (\ position\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) |const| |
  209. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | :ref:`Vector2<class_Vector2>` | :ref:`get_end<class_Control_method_get_end>`\ (\ ) |const| |
  211. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | :ref:`FocusMode<enum_Control_FocusMode>` | :ref:`get_focus_mode_with_override<class_Control_method_get_focus_mode_with_override>`\ (\ ) |const| |
  213. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | :ref:`NodePath<class_NodePath>` | :ref:`get_focus_neighbor<class_Control_method_get_focus_neighbor>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
  215. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | :ref:`Rect2<class_Rect2>` | :ref:`get_global_rect<class_Control_method_get_global_rect>`\ (\ ) |const| |
  217. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | :ref:`Vector2<class_Vector2>` | :ref:`get_minimum_size<class_Control_method_get_minimum_size>`\ (\ ) |const| |
  219. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | :ref:`MouseFilter<enum_Control_MouseFilter>` | :ref:`get_mouse_filter_with_override<class_Control_method_get_mouse_filter_with_override>`\ (\ ) |const| |
  221. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | :ref:`float<class_float>` | :ref:`get_offset<class_Control_method_get_offset>`\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
  223. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | :ref:`Vector2<class_Vector2>` | :ref:`get_parent_area_size<class_Control_method_get_parent_area_size>`\ (\ ) |const| |
  225. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | :ref:`Control<class_Control>` | :ref:`get_parent_control<class_Control_method_get_parent_control>`\ (\ ) |const| |
  227. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | :ref:`Rect2<class_Rect2>` | :ref:`get_rect<class_Control_method_get_rect>`\ (\ ) |const| |
  229. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | :ref:`Vector2<class_Vector2>` | :ref:`get_screen_position<class_Control_method_get_screen_position>`\ (\ ) |const| |
  231. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | :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| |
  233. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | :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| |
  235. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | :ref:`float<class_float>` | :ref:`get_theme_default_base_scale<class_Control_method_get_theme_default_base_scale>`\ (\ ) |const| |
  237. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | :ref:`Font<class_Font>` | :ref:`get_theme_default_font<class_Control_method_get_theme_default_font>`\ (\ ) |const| |
  239. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | :ref:`int<class_int>` | :ref:`get_theme_default_font_size<class_Control_method_get_theme_default_font_size>`\ (\ ) |const| |
  241. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | :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| |
  243. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | :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| |
  245. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | :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| |
  247. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | :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| |
  249. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | :ref:`String<class_String>` | :ref:`get_tooltip<class_Control_method_get_tooltip>`\ (\ at_position\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) |const| |
  251. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | |void| | :ref:`grab_click_focus<class_Control_method_grab_click_focus>`\ (\ ) |
  253. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | |void| | :ref:`grab_focus<class_Control_method_grab_focus>`\ (\ hide_focus\: :ref:`bool<class_bool>` = false\ ) |
  255. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | :ref:`bool<class_bool>` | :ref:`has_focus<class_Control_method_has_focus>`\ (\ ignore_hidden_focus\: :ref:`bool<class_bool>` = false\ ) |const| |
  257. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. | :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| |
  259. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  260. | :ref:`bool<class_bool>` | :ref:`has_theme_color_override<class_Control_method_has_theme_color_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  261. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  262. | :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| |
  263. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  264. | :ref:`bool<class_bool>` | :ref:`has_theme_constant_override<class_Control_method_has_theme_constant_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  265. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  266. | :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| |
  267. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  268. | :ref:`bool<class_bool>` | :ref:`has_theme_font_override<class_Control_method_has_theme_font_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  269. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  270. | :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| |
  271. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  272. | :ref:`bool<class_bool>` | :ref:`has_theme_font_size_override<class_Control_method_has_theme_font_size_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  273. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  274. | :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| |
  275. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  276. | :ref:`bool<class_bool>` | :ref:`has_theme_icon_override<class_Control_method_has_theme_icon_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  277. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  278. | :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| |
  279. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  280. | :ref:`bool<class_bool>` | :ref:`has_theme_stylebox_override<class_Control_method_has_theme_stylebox_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  281. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  282. | :ref:`bool<class_bool>` | :ref:`is_drag_successful<class_Control_method_is_drag_successful>`\ (\ ) |const| |
  283. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  284. | :ref:`bool<class_bool>` | :ref:`is_layout_rtl<class_Control_method_is_layout_rtl>`\ (\ ) |const| |
  285. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  286. | |void| | :ref:`release_focus<class_Control_method_release_focus>`\ (\ ) |
  287. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  288. | |void| | :ref:`remove_theme_color_override<class_Control_method_remove_theme_color_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  289. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  290. | |void| | :ref:`remove_theme_constant_override<class_Control_method_remove_theme_constant_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  291. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  292. | |void| | :ref:`remove_theme_font_override<class_Control_method_remove_theme_font_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  293. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  294. | |void| | :ref:`remove_theme_font_size_override<class_Control_method_remove_theme_font_size_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  295. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  296. | |void| | :ref:`remove_theme_icon_override<class_Control_method_remove_theme_icon_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  297. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  298. | |void| | :ref:`remove_theme_stylebox_override<class_Control_method_remove_theme_stylebox_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  299. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  300. | |void| | :ref:`reset_size<class_Control_method_reset_size>`\ (\ ) |
  301. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  302. | |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\ ) |
  303. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  304. | |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\ ) |
  305. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  306. | |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\ ) |
  307. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  308. | |void| | :ref:`set_anchors_preset<class_Control_method_set_anchors_preset>`\ (\ preset\: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) |
  309. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  310. | |void| | :ref:`set_begin<class_Control_method_set_begin>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |
  311. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  312. | |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>`\ ) |
  313. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  314. | |void| | :ref:`set_drag_preview<class_Control_method_set_drag_preview>`\ (\ control\: :ref:`Control<class_Control>`\ ) |
  315. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  316. | |void| | :ref:`set_end<class_Control_method_set_end>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |
  317. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  318. | |void| | :ref:`set_focus_neighbor<class_Control_method_set_focus_neighbor>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ ) |
  319. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  320. | |void| | :ref:`set_global_position<class_Control_method_set_global_position>`\ (\ position\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) |
  321. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  322. | |void| | :ref:`set_offset<class_Control_method_set_offset>`\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ ) |
  323. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  324. | |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\ ) |
  325. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  326. | |void| | :ref:`set_position<class_Control_method_set_position>`\ (\ position\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) |
  327. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  328. | |void| | :ref:`set_size<class_Control_method_set_size>`\ (\ size\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) |
  329. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  330. | |void| | :ref:`update_minimum_size<class_Control_method_update_minimum_size>`\ (\ ) |
  331. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  332. | |void| | :ref:`warp_mouse<class_Control_method_warp_mouse>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |
  333. +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  334. .. rst-class:: classref-section-separator
  335. ----
  336. .. rst-class:: classref-descriptions-group
  337. Signals
  338. -------
  339. .. _class_Control_signal_focus_entered:
  340. .. rst-class:: classref-signal
  341. **focus_entered**\ (\ ) :ref:`🔗<class_Control_signal_focus_entered>`
  342. Emitted when the node gains focus.
  343. .. rst-class:: classref-item-separator
  344. ----
  345. .. _class_Control_signal_focus_exited:
  346. .. rst-class:: classref-signal
  347. **focus_exited**\ (\ ) :ref:`🔗<class_Control_signal_focus_exited>`
  348. Emitted when the node loses focus.
  349. .. rst-class:: classref-item-separator
  350. ----
  351. .. _class_Control_signal_gui_input:
  352. .. rst-class:: classref-signal
  353. **gui_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) :ref:`🔗<class_Control_signal_gui_input>`
  354. Emitted when the node receives an :ref:`InputEvent<class_InputEvent>`.
  355. .. rst-class:: classref-item-separator
  356. ----
  357. .. _class_Control_signal_minimum_size_changed:
  358. .. rst-class:: classref-signal
  359. **minimum_size_changed**\ (\ ) :ref:`🔗<class_Control_signal_minimum_size_changed>`
  360. Emitted when the node's minimum size changes.
  361. .. rst-class:: classref-item-separator
  362. ----
  363. .. _class_Control_signal_mouse_entered:
  364. .. rst-class:: classref-signal
  365. **mouse_entered**\ (\ ) :ref:`🔗<class_Control_signal_mouse_entered>`
  366. 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.
  367. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect, which Control receives the signal.
  368. .. rst-class:: classref-item-separator
  369. ----
  370. .. _class_Control_signal_mouse_exited:
  371. .. rst-class:: classref-signal
  372. **mouse_exited**\ (\ ) :ref:`🔗<class_Control_signal_mouse_exited>`
  373. 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.
  374. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect, which Control receives the signal.
  375. \ **Note:** If you want to check whether the mouse truly left the area, ignoring any top nodes, you can use code like this:
  376. ::
  377. func _on_mouse_exited():
  378. if not Rect2(Vector2(), size).has_point(get_local_mouse_position()):
  379. # Not hovering over area.
  380. .. rst-class:: classref-item-separator
  381. ----
  382. .. _class_Control_signal_resized:
  383. .. rst-class:: classref-signal
  384. **resized**\ (\ ) :ref:`🔗<class_Control_signal_resized>`
  385. Emitted when the control changes size.
  386. .. rst-class:: classref-item-separator
  387. ----
  388. .. _class_Control_signal_size_flags_changed:
  389. .. rst-class:: classref-signal
  390. **size_flags_changed**\ (\ ) :ref:`🔗<class_Control_signal_size_flags_changed>`
  391. 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>`.
  392. .. rst-class:: classref-item-separator
  393. ----
  394. .. _class_Control_signal_theme_changed:
  395. .. rst-class:: classref-signal
  396. **theme_changed**\ (\ ) :ref:`🔗<class_Control_signal_theme_changed>`
  397. Emitted when the :ref:`NOTIFICATION_THEME_CHANGED<class_Control_constant_NOTIFICATION_THEME_CHANGED>` notification is sent.
  398. .. rst-class:: classref-section-separator
  399. ----
  400. .. rst-class:: classref-descriptions-group
  401. Enumerations
  402. ------------
  403. .. _enum_Control_FocusMode:
  404. .. rst-class:: classref-enumeration
  405. enum **FocusMode**: :ref:`🔗<enum_Control_FocusMode>`
  406. .. _class_Control_constant_FOCUS_NONE:
  407. .. rst-class:: classref-enumeration-constant
  408. :ref:`FocusMode<enum_Control_FocusMode>` **FOCUS_NONE** = ``0``
  409. The node cannot grab focus. Use with :ref:`focus_mode<class_Control_property_focus_mode>`.
  410. .. _class_Control_constant_FOCUS_CLICK:
  411. .. rst-class:: classref-enumeration-constant
  412. :ref:`FocusMode<enum_Control_FocusMode>` **FOCUS_CLICK** = ``1``
  413. The node can only grab focus on mouse clicks. Use with :ref:`focus_mode<class_Control_property_focus_mode>`.
  414. .. _class_Control_constant_FOCUS_ALL:
  415. .. rst-class:: classref-enumeration-constant
  416. :ref:`FocusMode<enum_Control_FocusMode>` **FOCUS_ALL** = ``2``
  417. 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>`.
  418. .. _class_Control_constant_FOCUS_ACCESSIBILITY:
  419. .. rst-class:: classref-enumeration-constant
  420. :ref:`FocusMode<enum_Control_FocusMode>` **FOCUS_ACCESSIBILITY** = ``3``
  421. The node can grab focus only when screen reader is active. Use with :ref:`focus_mode<class_Control_property_focus_mode>`.
  422. .. rst-class:: classref-item-separator
  423. ----
  424. .. _enum_Control_FocusBehaviorRecursive:
  425. .. rst-class:: classref-enumeration
  426. enum **FocusBehaviorRecursive**: :ref:`🔗<enum_Control_FocusBehaviorRecursive>`
  427. .. _class_Control_constant_FOCUS_BEHAVIOR_INHERITED:
  428. .. rst-class:: classref-enumeration-constant
  429. :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` **FOCUS_BEHAVIOR_INHERITED** = ``0``
  430. 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>`.
  431. .. _class_Control_constant_FOCUS_BEHAVIOR_DISABLED:
  432. .. rst-class:: classref-enumeration-constant
  433. :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` **FOCUS_BEHAVIOR_DISABLED** = ``1``
  434. 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>`.
  435. .. _class_Control_constant_FOCUS_BEHAVIOR_ENABLED:
  436. .. rst-class:: classref-enumeration-constant
  437. :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` **FOCUS_BEHAVIOR_ENABLED** = ``2``
  438. 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>`.
  439. .. rst-class:: classref-item-separator
  440. ----
  441. .. _enum_Control_MouseBehaviorRecursive:
  442. .. rst-class:: classref-enumeration
  443. enum **MouseBehaviorRecursive**: :ref:`🔗<enum_Control_MouseBehaviorRecursive>`
  444. .. _class_Control_constant_MOUSE_BEHAVIOR_INHERITED:
  445. .. rst-class:: classref-enumeration-constant
  446. :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` **MOUSE_BEHAVIOR_INHERITED** = ``0``
  447. 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>`.
  448. .. _class_Control_constant_MOUSE_BEHAVIOR_DISABLED:
  449. .. rst-class:: classref-enumeration-constant
  450. :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` **MOUSE_BEHAVIOR_DISABLED** = ``1``
  451. 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>`.
  452. .. _class_Control_constant_MOUSE_BEHAVIOR_ENABLED:
  453. .. rst-class:: classref-enumeration-constant
  454. :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` **MOUSE_BEHAVIOR_ENABLED** = ``2``
  455. 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>`.
  456. .. rst-class:: classref-item-separator
  457. ----
  458. .. _enum_Control_CursorShape:
  459. .. rst-class:: classref-enumeration
  460. enum **CursorShape**: :ref:`🔗<enum_Control_CursorShape>`
  461. .. _class_Control_constant_CURSOR_ARROW:
  462. .. rst-class:: classref-enumeration-constant
  463. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_ARROW** = ``0``
  464. 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>`.
  465. .. _class_Control_constant_CURSOR_IBEAM:
  466. .. rst-class:: classref-enumeration-constant
  467. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_IBEAM** = ``1``
  468. 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.
  469. .. _class_Control_constant_CURSOR_POINTING_HAND:
  470. .. rst-class:: classref-enumeration-constant
  471. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_POINTING_HAND** = ``2``
  472. Show the system's pointing hand mouse cursor when the user hovers the node.
  473. .. _class_Control_constant_CURSOR_CROSS:
  474. .. rst-class:: classref-enumeration-constant
  475. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_CROSS** = ``3``
  476. Show the system's cross mouse cursor when the user hovers the node.
  477. .. _class_Control_constant_CURSOR_WAIT:
  478. .. rst-class:: classref-enumeration-constant
  479. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_WAIT** = ``4``
  480. Show the system's wait mouse cursor when the user hovers the node. Often an hourglass.
  481. .. _class_Control_constant_CURSOR_BUSY:
  482. .. rst-class:: classref-enumeration-constant
  483. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_BUSY** = ``5``
  484. Show the system's busy mouse cursor when the user hovers the node. Often an arrow with a small hourglass.
  485. .. _class_Control_constant_CURSOR_DRAG:
  486. .. rst-class:: classref-enumeration-constant
  487. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_DRAG** = ``6``
  488. 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.
  489. .. _class_Control_constant_CURSOR_CAN_DROP:
  490. .. rst-class:: classref-enumeration-constant
  491. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_CAN_DROP** = ``7``
  492. 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.
  493. .. _class_Control_constant_CURSOR_FORBIDDEN:
  494. .. rst-class:: classref-enumeration-constant
  495. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_FORBIDDEN** = ``8``
  496. Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle.
  497. .. _class_Control_constant_CURSOR_VSIZE:
  498. .. rst-class:: classref-enumeration-constant
  499. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_VSIZE** = ``9``
  500. 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.
  501. .. _class_Control_constant_CURSOR_HSIZE:
  502. .. rst-class:: classref-enumeration-constant
  503. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_HSIZE** = ``10``
  504. 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.
  505. .. _class_Control_constant_CURSOR_BDIAGSIZE:
  506. .. rst-class:: classref-enumeration-constant
  507. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_BDIAGSIZE** = ``11``
  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 bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically.
  509. .. _class_Control_constant_CURSOR_FDIAGSIZE:
  510. .. rst-class:: classref-enumeration-constant
  511. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_FDIAGSIZE** = ``12``
  512. 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.
  513. .. _class_Control_constant_CURSOR_MOVE:
  514. .. rst-class:: classref-enumeration-constant
  515. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_MOVE** = ``13``
  516. 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.
  517. .. _class_Control_constant_CURSOR_VSPLIT:
  518. .. rst-class:: classref-enumeration-constant
  519. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_VSPLIT** = ``14``
  520. 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>`.
  521. .. _class_Control_constant_CURSOR_HSPLIT:
  522. .. rst-class:: classref-enumeration-constant
  523. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_HSPLIT** = ``15``
  524. 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>`.
  525. .. _class_Control_constant_CURSOR_HELP:
  526. .. rst-class:: classref-enumeration-constant
  527. :ref:`CursorShape<enum_Control_CursorShape>` **CURSOR_HELP** = ``16``
  528. Show the system's help mouse cursor when the user hovers the node, a question mark.
  529. .. rst-class:: classref-item-separator
  530. ----
  531. .. _enum_Control_LayoutPreset:
  532. .. rst-class:: classref-enumeration
  533. enum **LayoutPreset**: :ref:`🔗<enum_Control_LayoutPreset>`
  534. .. _class_Control_constant_PRESET_TOP_LEFT:
  535. .. rst-class:: classref-enumeration-constant
  536. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_TOP_LEFT** = ``0``
  537. 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>`.
  538. .. _class_Control_constant_PRESET_TOP_RIGHT:
  539. .. rst-class:: classref-enumeration-constant
  540. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_TOP_RIGHT** = ``1``
  541. 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>`.
  542. .. _class_Control_constant_PRESET_BOTTOM_LEFT:
  543. .. rst-class:: classref-enumeration-constant
  544. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_BOTTOM_LEFT** = ``2``
  545. 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>`.
  546. .. _class_Control_constant_PRESET_BOTTOM_RIGHT:
  547. .. rst-class:: classref-enumeration-constant
  548. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_BOTTOM_RIGHT** = ``3``
  549. 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>`.
  550. .. _class_Control_constant_PRESET_CENTER_LEFT:
  551. .. rst-class:: classref-enumeration-constant
  552. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_CENTER_LEFT** = ``4``
  553. 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>`.
  554. .. _class_Control_constant_PRESET_CENTER_TOP:
  555. .. rst-class:: classref-enumeration-constant
  556. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_CENTER_TOP** = ``5``
  557. 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>`.
  558. .. _class_Control_constant_PRESET_CENTER_RIGHT:
  559. .. rst-class:: classref-enumeration-constant
  560. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_CENTER_RIGHT** = ``6``
  561. 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>`.
  562. .. _class_Control_constant_PRESET_CENTER_BOTTOM:
  563. .. rst-class:: classref-enumeration-constant
  564. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_CENTER_BOTTOM** = ``7``
  565. 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>`.
  566. .. _class_Control_constant_PRESET_CENTER:
  567. .. rst-class:: classref-enumeration-constant
  568. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_CENTER** = ``8``
  569. 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>`.
  570. .. _class_Control_constant_PRESET_LEFT_WIDE:
  571. .. rst-class:: classref-enumeration-constant
  572. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_LEFT_WIDE** = ``9``
  573. 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>`.
  574. .. _class_Control_constant_PRESET_TOP_WIDE:
  575. .. rst-class:: classref-enumeration-constant
  576. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_TOP_WIDE** = ``10``
  577. 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>`.
  578. .. _class_Control_constant_PRESET_RIGHT_WIDE:
  579. .. rst-class:: classref-enumeration-constant
  580. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_RIGHT_WIDE** = ``11``
  581. 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>`.
  582. .. _class_Control_constant_PRESET_BOTTOM_WIDE:
  583. .. rst-class:: classref-enumeration-constant
  584. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_BOTTOM_WIDE** = ``12``
  585. 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>`.
  586. .. _class_Control_constant_PRESET_VCENTER_WIDE:
  587. .. rst-class:: classref-enumeration-constant
  588. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_VCENTER_WIDE** = ``13``
  589. 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>`.
  590. .. _class_Control_constant_PRESET_HCENTER_WIDE:
  591. .. rst-class:: classref-enumeration-constant
  592. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_HCENTER_WIDE** = ``14``
  593. 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>`.
  594. .. _class_Control_constant_PRESET_FULL_RECT:
  595. .. rst-class:: classref-enumeration-constant
  596. :ref:`LayoutPreset<enum_Control_LayoutPreset>` **PRESET_FULL_RECT** = ``15``
  597. 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>`.
  598. .. rst-class:: classref-item-separator
  599. ----
  600. .. _enum_Control_LayoutPresetMode:
  601. .. rst-class:: classref-enumeration
  602. enum **LayoutPresetMode**: :ref:`🔗<enum_Control_LayoutPresetMode>`
  603. .. _class_Control_constant_PRESET_MODE_MINSIZE:
  604. .. rst-class:: classref-enumeration-constant
  605. :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` **PRESET_MODE_MINSIZE** = ``0``
  606. The control will be resized to its minimum size.
  607. .. _class_Control_constant_PRESET_MODE_KEEP_WIDTH:
  608. .. rst-class:: classref-enumeration-constant
  609. :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` **PRESET_MODE_KEEP_WIDTH** = ``1``
  610. The control's width will not change.
  611. .. _class_Control_constant_PRESET_MODE_KEEP_HEIGHT:
  612. .. rst-class:: classref-enumeration-constant
  613. :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` **PRESET_MODE_KEEP_HEIGHT** = ``2``
  614. The control's height will not change.
  615. .. _class_Control_constant_PRESET_MODE_KEEP_SIZE:
  616. .. rst-class:: classref-enumeration-constant
  617. :ref:`LayoutPresetMode<enum_Control_LayoutPresetMode>` **PRESET_MODE_KEEP_SIZE** = ``3``
  618. The control's size will not change.
  619. .. rst-class:: classref-item-separator
  620. ----
  621. .. _enum_Control_SizeFlags:
  622. .. rst-class:: classref-enumeration
  623. flags **SizeFlags**: :ref:`🔗<enum_Control_SizeFlags>`
  624. .. _class_Control_constant_SIZE_SHRINK_BEGIN:
  625. .. rst-class:: classref-enumeration-constant
  626. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_SHRINK_BEGIN** = ``0``
  627. 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>`.
  628. \ **Note:** Setting this flag is equal to not having any size flags.
  629. .. _class_Control_constant_SIZE_FILL:
  630. .. rst-class:: classref-enumeration-constant
  631. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_FILL** = ``1``
  632. 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>`.
  633. .. _class_Control_constant_SIZE_EXPAND:
  634. .. rst-class:: classref-enumeration-constant
  635. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_EXPAND** = ``2``
  636. 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>`.
  637. .. _class_Control_constant_SIZE_EXPAND_FILL:
  638. .. rst-class:: classref-enumeration-constant
  639. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_EXPAND_FILL** = ``3``
  640. 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.
  641. .. _class_Control_constant_SIZE_SHRINK_CENTER:
  642. .. rst-class:: classref-enumeration-constant
  643. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_SHRINK_CENTER** = ``4``
  644. 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>`.
  645. .. _class_Control_constant_SIZE_SHRINK_END:
  646. .. rst-class:: classref-enumeration-constant
  647. :ref:`SizeFlags<enum_Control_SizeFlags>` **SIZE_SHRINK_END** = ``8``
  648. 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>`.
  649. .. rst-class:: classref-item-separator
  650. ----
  651. .. _enum_Control_MouseFilter:
  652. .. rst-class:: classref-enumeration
  653. enum **MouseFilter**: :ref:`🔗<enum_Control_MouseFilter>`
  654. .. _class_Control_constant_MOUSE_FILTER_STOP:
  655. .. rst-class:: classref-enumeration-constant
  656. :ref:`MouseFilter<enum_Control_MouseFilter>` **MOUSE_FILTER_STOP** = ``0``
  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. 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.
  658. .. _class_Control_constant_MOUSE_FILTER_PASS:
  659. .. rst-class:: classref-enumeration-constant
  660. :ref:`MouseFilter<enum_Control_MouseFilter>` **MOUSE_FILTER_PASS** = ``1``
  661. 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.
  662. 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.
  663. .. _class_Control_constant_MOUSE_FILTER_IGNORE:
  664. .. rst-class:: classref-enumeration-constant
  665. :ref:`MouseFilter<enum_Control_MouseFilter>` **MOUSE_FILTER_IGNORE** = ``2``
  666. 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.
  667. \ **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.
  668. .. rst-class:: classref-item-separator
  669. ----
  670. .. _enum_Control_GrowDirection:
  671. .. rst-class:: classref-enumeration
  672. enum **GrowDirection**: :ref:`🔗<enum_Control_GrowDirection>`
  673. .. _class_Control_constant_GROW_DIRECTION_BEGIN:
  674. .. rst-class:: classref-enumeration-constant
  675. :ref:`GrowDirection<enum_Control_GrowDirection>` **GROW_DIRECTION_BEGIN** = ``0``
  676. 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.
  677. .. _class_Control_constant_GROW_DIRECTION_END:
  678. .. rst-class:: classref-enumeration-constant
  679. :ref:`GrowDirection<enum_Control_GrowDirection>` **GROW_DIRECTION_END** = ``1``
  680. 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.
  681. .. _class_Control_constant_GROW_DIRECTION_BOTH:
  682. .. rst-class:: classref-enumeration-constant
  683. :ref:`GrowDirection<enum_Control_GrowDirection>` **GROW_DIRECTION_BOTH** = ``2``
  684. The control will grow in both directions equally to make up if its minimum size is changed to be greater than its current size.
  685. .. rst-class:: classref-item-separator
  686. ----
  687. .. _enum_Control_Anchor:
  688. .. rst-class:: classref-enumeration
  689. enum **Anchor**: :ref:`🔗<enum_Control_Anchor>`
  690. .. _class_Control_constant_ANCHOR_BEGIN:
  691. .. rst-class:: classref-enumeration-constant
  692. :ref:`Anchor<enum_Control_Anchor>` **ANCHOR_BEGIN** = ``0``
  693. 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>`.
  694. .. _class_Control_constant_ANCHOR_END:
  695. .. rst-class:: classref-enumeration-constant
  696. :ref:`Anchor<enum_Control_Anchor>` **ANCHOR_END** = ``1``
  697. 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>`.
  698. .. rst-class:: classref-item-separator
  699. ----
  700. .. _enum_Control_LayoutDirection:
  701. .. rst-class:: classref-enumeration
  702. enum **LayoutDirection**: :ref:`🔗<enum_Control_LayoutDirection>`
  703. .. _class_Control_constant_LAYOUT_DIRECTION_INHERITED:
  704. .. rst-class:: classref-enumeration-constant
  705. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_INHERITED** = ``0``
  706. Automatic layout direction, determined from the parent control layout direction.
  707. .. _class_Control_constant_LAYOUT_DIRECTION_APPLICATION_LOCALE:
  708. .. rst-class:: classref-enumeration-constant
  709. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_APPLICATION_LOCALE** = ``1``
  710. 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>`.
  711. .. _class_Control_constant_LAYOUT_DIRECTION_LTR:
  712. .. rst-class:: classref-enumeration-constant
  713. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_LTR** = ``2``
  714. Left-to-right layout direction.
  715. .. _class_Control_constant_LAYOUT_DIRECTION_RTL:
  716. .. rst-class:: classref-enumeration-constant
  717. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_RTL** = ``3``
  718. Right-to-left layout direction.
  719. .. _class_Control_constant_LAYOUT_DIRECTION_SYSTEM_LOCALE:
  720. .. rst-class:: classref-enumeration-constant
  721. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_SYSTEM_LOCALE** = ``4``
  722. 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.
  723. .. _class_Control_constant_LAYOUT_DIRECTION_MAX:
  724. .. rst-class:: classref-enumeration-constant
  725. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_MAX** = ``5``
  726. Represents the size of the :ref:`LayoutDirection<enum_Control_LayoutDirection>` enum.
  727. .. _class_Control_constant_LAYOUT_DIRECTION_LOCALE:
  728. .. rst-class:: classref-enumeration-constant
  729. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **LAYOUT_DIRECTION_LOCALE** = ``1``
  730. **Deprecated:** Use :ref:`LAYOUT_DIRECTION_APPLICATION_LOCALE<class_Control_constant_LAYOUT_DIRECTION_APPLICATION_LOCALE>` instead.
  731. .. rst-class:: classref-item-separator
  732. ----
  733. .. _enum_Control_TextDirection:
  734. .. rst-class:: classref-enumeration
  735. enum **TextDirection**: :ref:`🔗<enum_Control_TextDirection>`
  736. .. _class_Control_constant_TEXT_DIRECTION_INHERITED:
  737. .. rst-class:: classref-enumeration-constant
  738. :ref:`TextDirection<enum_Control_TextDirection>` **TEXT_DIRECTION_INHERITED** = ``3``
  739. Text writing direction is the same as layout direction.
  740. .. _class_Control_constant_TEXT_DIRECTION_AUTO:
  741. .. rst-class:: classref-enumeration-constant
  742. :ref:`TextDirection<enum_Control_TextDirection>` **TEXT_DIRECTION_AUTO** = ``0``
  743. Automatic text writing direction, determined from the current locale and text content.
  744. .. _class_Control_constant_TEXT_DIRECTION_LTR:
  745. .. rst-class:: classref-enumeration-constant
  746. :ref:`TextDirection<enum_Control_TextDirection>` **TEXT_DIRECTION_LTR** = ``1``
  747. Left-to-right text writing direction.
  748. .. _class_Control_constant_TEXT_DIRECTION_RTL:
  749. .. rst-class:: classref-enumeration-constant
  750. :ref:`TextDirection<enum_Control_TextDirection>` **TEXT_DIRECTION_RTL** = ``2``
  751. Right-to-left text writing direction.
  752. .. rst-class:: classref-section-separator
  753. ----
  754. .. rst-class:: classref-descriptions-group
  755. Constants
  756. ---------
  757. .. _class_Control_constant_NOTIFICATION_RESIZED:
  758. .. rst-class:: classref-constant
  759. **NOTIFICATION_RESIZED** = ``40`` :ref:`🔗<class_Control_constant_NOTIFICATION_RESIZED>`
  760. Sent when the node changes size. Use :ref:`size<class_Control_property_size>` to get the new size.
  761. .. _class_Control_constant_NOTIFICATION_MOUSE_ENTER:
  762. .. rst-class:: classref-constant
  763. **NOTIFICATION_MOUSE_ENTER** = ``41`` :ref:`🔗<class_Control_constant_NOTIFICATION_MOUSE_ENTER>`
  764. 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.
  765. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.
  766. See also :ref:`NOTIFICATION_MOUSE_ENTER_SELF<class_Control_constant_NOTIFICATION_MOUSE_ENTER_SELF>`.
  767. .. _class_Control_constant_NOTIFICATION_MOUSE_EXIT:
  768. .. rst-class:: classref-constant
  769. **NOTIFICATION_MOUSE_EXIT** = ``42`` :ref:`🔗<class_Control_constant_NOTIFICATION_MOUSE_EXIT>`
  770. 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.
  771. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.
  772. See also :ref:`NOTIFICATION_MOUSE_EXIT_SELF<class_Control_constant_NOTIFICATION_MOUSE_EXIT_SELF>`.
  773. .. _class_Control_constant_NOTIFICATION_MOUSE_ENTER_SELF:
  774. .. rst-class:: classref-constant
  775. **NOTIFICATION_MOUSE_ENTER_SELF** = ``60`` :ref:`🔗<class_Control_constant_NOTIFICATION_MOUSE_ENTER_SELF>`
  776. **Experimental:** The reason this notification is sent may change in the future.
  777. 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.
  778. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.
  779. See also :ref:`NOTIFICATION_MOUSE_ENTER<class_Control_constant_NOTIFICATION_MOUSE_ENTER>`.
  780. .. _class_Control_constant_NOTIFICATION_MOUSE_EXIT_SELF:
  781. .. rst-class:: classref-constant
  782. **NOTIFICATION_MOUSE_EXIT_SELF** = ``61`` :ref:`🔗<class_Control_constant_NOTIFICATION_MOUSE_EXIT_SELF>`
  783. **Experimental:** The reason this notification is sent may change in the future.
  784. 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.
  785. \ **Note:** :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` doesn't affect which Control receives the notification.
  786. See also :ref:`NOTIFICATION_MOUSE_EXIT<class_Control_constant_NOTIFICATION_MOUSE_EXIT>`.
  787. .. _class_Control_constant_NOTIFICATION_FOCUS_ENTER:
  788. .. rst-class:: classref-constant
  789. **NOTIFICATION_FOCUS_ENTER** = ``43`` :ref:`🔗<class_Control_constant_NOTIFICATION_FOCUS_ENTER>`
  790. Sent when the node grabs focus.
  791. .. _class_Control_constant_NOTIFICATION_FOCUS_EXIT:
  792. .. rst-class:: classref-constant
  793. **NOTIFICATION_FOCUS_EXIT** = ``44`` :ref:`🔗<class_Control_constant_NOTIFICATION_FOCUS_EXIT>`
  794. Sent when the node loses focus.
  795. .. _class_Control_constant_NOTIFICATION_THEME_CHANGED:
  796. .. rst-class:: classref-constant
  797. **NOTIFICATION_THEME_CHANGED** = ``45`` :ref:`🔗<class_Control_constant_NOTIFICATION_THEME_CHANGED>`
  798. Sent when the node needs to refresh its theme items. This happens in one of the following cases:
  799. - The :ref:`theme<class_Control_property_theme>` property is changed on this node or any of its ancestors.
  800. - The :ref:`theme_type_variation<class_Control_property_theme_type_variation>` property is changed on this node.
  801. - One of the node's theme property overrides is changed.
  802. - The node enters the scene tree.
  803. \ **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.
  804. \ **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>`.
  805. ::
  806. func _notification(what):
  807. if what == NOTIFICATION_THEME_CHANGED:
  808. if not is_node_ready():
  809. await ready # Wait until ready signal.
  810. $Label.add_theme_color_override("font_color", Color.YELLOW)
  811. .. _class_Control_constant_NOTIFICATION_SCROLL_BEGIN:
  812. .. rst-class:: classref-constant
  813. **NOTIFICATION_SCROLL_BEGIN** = ``47`` :ref:`🔗<class_Control_constant_NOTIFICATION_SCROLL_BEGIN>`
  814. 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.
  815. \ **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.
  816. .. _class_Control_constant_NOTIFICATION_SCROLL_END:
  817. .. rst-class:: classref-constant
  818. **NOTIFICATION_SCROLL_END** = ``48`` :ref:`🔗<class_Control_constant_NOTIFICATION_SCROLL_END>`
  819. 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.
  820. \ **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.
  821. .. _class_Control_constant_NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
  822. .. rst-class:: classref-constant
  823. **NOTIFICATION_LAYOUT_DIRECTION_CHANGED** = ``49`` :ref:`🔗<class_Control_constant_NOTIFICATION_LAYOUT_DIRECTION_CHANGED>`
  824. 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>`.
  825. .. rst-class:: classref-section-separator
  826. ----
  827. .. rst-class:: classref-descriptions-group
  828. Property Descriptions
  829. ---------------------
  830. .. _class_Control_property_accessibility_controls_nodes:
  831. .. rst-class:: classref-property
  832. :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **accessibility_controls_nodes** = ``[]`` :ref:`🔗<class_Control_property_accessibility_controls_nodes>`
  833. .. rst-class:: classref-property-setget
  834. - |void| **set_accessibility_controls_nodes**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\]\ )
  835. - :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **get_accessibility_controls_nodes**\ (\ )
  836. The paths to the nodes which are controlled by this node.
  837. .. rst-class:: classref-item-separator
  838. ----
  839. .. _class_Control_property_accessibility_described_by_nodes:
  840. .. rst-class:: classref-property
  841. :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **accessibility_described_by_nodes** = ``[]`` :ref:`🔗<class_Control_property_accessibility_described_by_nodes>`
  842. .. rst-class:: classref-property-setget
  843. - |void| **set_accessibility_described_by_nodes**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\]\ )
  844. - :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **get_accessibility_described_by_nodes**\ (\ )
  845. The paths to the nodes which are describing this node.
  846. .. rst-class:: classref-item-separator
  847. ----
  848. .. _class_Control_property_accessibility_description:
  849. .. rst-class:: classref-property
  850. :ref:`String<class_String>` **accessibility_description** = ``""`` :ref:`🔗<class_Control_property_accessibility_description>`
  851. .. rst-class:: classref-property-setget
  852. - |void| **set_accessibility_description**\ (\ value\: :ref:`String<class_String>`\ )
  853. - :ref:`String<class_String>` **get_accessibility_description**\ (\ )
  854. The human-readable node description that is reported to assistive apps.
  855. .. rst-class:: classref-item-separator
  856. ----
  857. .. _class_Control_property_accessibility_flow_to_nodes:
  858. .. rst-class:: classref-property
  859. :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **accessibility_flow_to_nodes** = ``[]`` :ref:`🔗<class_Control_property_accessibility_flow_to_nodes>`
  860. .. rst-class:: classref-property-setget
  861. - |void| **set_accessibility_flow_to_nodes**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\]\ )
  862. - :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **get_accessibility_flow_to_nodes**\ (\ )
  863. The paths to the nodes which this node flows into.
  864. .. rst-class:: classref-item-separator
  865. ----
  866. .. _class_Control_property_accessibility_labeled_by_nodes:
  867. .. rst-class:: classref-property
  868. :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **accessibility_labeled_by_nodes** = ``[]`` :ref:`🔗<class_Control_property_accessibility_labeled_by_nodes>`
  869. .. rst-class:: classref-property-setget
  870. - |void| **set_accessibility_labeled_by_nodes**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\]\ )
  871. - :ref:`Array<class_Array>`\[:ref:`NodePath<class_NodePath>`\] **get_accessibility_labeled_by_nodes**\ (\ )
  872. The paths to the nodes which label this node.
  873. .. rst-class:: classref-item-separator
  874. ----
  875. .. _class_Control_property_accessibility_live:
  876. .. rst-class:: classref-property
  877. :ref:`AccessibilityLiveMode<enum_DisplayServer_AccessibilityLiveMode>` **accessibility_live** = ``0`` :ref:`🔗<class_Control_property_accessibility_live>`
  878. .. rst-class:: classref-property-setget
  879. - |void| **set_accessibility_live**\ (\ value\: :ref:`AccessibilityLiveMode<enum_DisplayServer_AccessibilityLiveMode>`\ )
  880. - :ref:`AccessibilityLiveMode<enum_DisplayServer_AccessibilityLiveMode>` **get_accessibility_live**\ (\ )
  881. 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.
  882. .. rst-class:: classref-item-separator
  883. ----
  884. .. _class_Control_property_accessibility_name:
  885. .. rst-class:: classref-property
  886. :ref:`String<class_String>` **accessibility_name** = ``""`` :ref:`🔗<class_Control_property_accessibility_name>`
  887. .. rst-class:: classref-property-setget
  888. - |void| **set_accessibility_name**\ (\ value\: :ref:`String<class_String>`\ )
  889. - :ref:`String<class_String>` **get_accessibility_name**\ (\ )
  890. The human-readable node name that is reported to assistive apps.
  891. .. rst-class:: classref-item-separator
  892. ----
  893. .. _class_Control_property_anchor_bottom:
  894. .. rst-class:: classref-property
  895. :ref:`float<class_float>` **anchor_bottom** = ``0.0`` :ref:`🔗<class_Control_property_anchor_bottom>`
  896. .. rst-class:: classref-property-setget
  897. - :ref:`float<class_float>` **get_anchor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  898. 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.
  899. .. rst-class:: classref-item-separator
  900. ----
  901. .. _class_Control_property_anchor_left:
  902. .. rst-class:: classref-property
  903. :ref:`float<class_float>` **anchor_left** = ``0.0`` :ref:`🔗<class_Control_property_anchor_left>`
  904. .. rst-class:: classref-property-setget
  905. - :ref:`float<class_float>` **get_anchor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  906. 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.
  907. .. rst-class:: classref-item-separator
  908. ----
  909. .. _class_Control_property_anchor_right:
  910. .. rst-class:: classref-property
  911. :ref:`float<class_float>` **anchor_right** = ``0.0`` :ref:`🔗<class_Control_property_anchor_right>`
  912. .. rst-class:: classref-property-setget
  913. - :ref:`float<class_float>` **get_anchor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  914. 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.
  915. .. rst-class:: classref-item-separator
  916. ----
  917. .. _class_Control_property_anchor_top:
  918. .. rst-class:: classref-property
  919. :ref:`float<class_float>` **anchor_top** = ``0.0`` :ref:`🔗<class_Control_property_anchor_top>`
  920. .. rst-class:: classref-property-setget
  921. - :ref:`float<class_float>` **get_anchor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  922. 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.
  923. .. rst-class:: classref-item-separator
  924. ----
  925. .. _class_Control_property_auto_translate:
  926. .. rst-class:: classref-property
  927. :ref:`bool<class_bool>` **auto_translate** :ref:`🔗<class_Control_property_auto_translate>`
  928. .. rst-class:: classref-property-setget
  929. - |void| **set_auto_translate**\ (\ value\: :ref:`bool<class_bool>`\ )
  930. - :ref:`bool<class_bool>` **is_auto_translating**\ (\ )
  931. **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.
  932. Toggles if any text should automatically change to its translated version depending on the current locale.
  933. .. rst-class:: classref-item-separator
  934. ----
  935. .. _class_Control_property_clip_contents:
  936. .. rst-class:: classref-property
  937. :ref:`bool<class_bool>` **clip_contents** = ``false`` :ref:`🔗<class_Control_property_clip_contents>`
  938. .. rst-class:: classref-property-setget
  939. - |void| **set_clip_contents**\ (\ value\: :ref:`bool<class_bool>`\ )
  940. - :ref:`bool<class_bool>` **is_clipping_contents**\ (\ )
  941. 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.
  942. .. rst-class:: classref-item-separator
  943. ----
  944. .. _class_Control_property_custom_minimum_size:
  945. .. rst-class:: classref-property
  946. :ref:`Vector2<class_Vector2>` **custom_minimum_size** = ``Vector2(0, 0)`` :ref:`🔗<class_Control_property_custom_minimum_size>`
  947. .. rst-class:: classref-property-setget
  948. - |void| **set_custom_minimum_size**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  949. - :ref:`Vector2<class_Vector2>` **get_custom_minimum_size**\ (\ )
  950. 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>`).
  951. .. rst-class:: classref-item-separator
  952. ----
  953. .. _class_Control_property_focus_behavior_recursive:
  954. .. rst-class:: classref-property
  955. :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` **focus_behavior_recursive** = ``0`` :ref:`🔗<class_Control_property_focus_behavior_recursive>`
  956. .. rst-class:: classref-property-setget
  957. - |void| **set_focus_behavior_recursive**\ (\ value\: :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>`\ )
  958. - :ref:`FocusBehaviorRecursive<enum_Control_FocusBehaviorRecursive>` **get_focus_behavior_recursive**\ (\ )
  959. 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.
  960. .. rst-class:: classref-item-separator
  961. ----
  962. .. _class_Control_property_focus_mode:
  963. .. rst-class:: classref-property
  964. :ref:`FocusMode<enum_Control_FocusMode>` **focus_mode** = ``0`` :ref:`🔗<class_Control_property_focus_mode>`
  965. .. rst-class:: classref-property-setget
  966. - |void| **set_focus_mode**\ (\ value\: :ref:`FocusMode<enum_Control_FocusMode>`\ )
  967. - :ref:`FocusMode<enum_Control_FocusMode>` **get_focus_mode**\ (\ )
  968. 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>`.
  969. .. rst-class:: classref-item-separator
  970. ----
  971. .. _class_Control_property_focus_neighbor_bottom:
  972. .. rst-class:: classref-property
  973. :ref:`NodePath<class_NodePath>` **focus_neighbor_bottom** = ``NodePath("")`` :ref:`🔗<class_Control_property_focus_neighbor_bottom>`
  974. .. rst-class:: classref-property-setget
  975. - |void| **set_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ )
  976. - :ref:`NodePath<class_NodePath>` **get_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  977. 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.
  978. .. rst-class:: classref-item-separator
  979. ----
  980. .. _class_Control_property_focus_neighbor_left:
  981. .. rst-class:: classref-property
  982. :ref:`NodePath<class_NodePath>` **focus_neighbor_left** = ``NodePath("")`` :ref:`🔗<class_Control_property_focus_neighbor_left>`
  983. .. rst-class:: classref-property-setget
  984. - |void| **set_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ )
  985. - :ref:`NodePath<class_NodePath>` **get_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  986. 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.
  987. .. rst-class:: classref-item-separator
  988. ----
  989. .. _class_Control_property_focus_neighbor_right:
  990. .. rst-class:: classref-property
  991. :ref:`NodePath<class_NodePath>` **focus_neighbor_right** = ``NodePath("")`` :ref:`🔗<class_Control_property_focus_neighbor_right>`
  992. .. rst-class:: classref-property-setget
  993. - |void| **set_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ )
  994. - :ref:`NodePath<class_NodePath>` **get_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  995. 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.
  996. .. rst-class:: classref-item-separator
  997. ----
  998. .. _class_Control_property_focus_neighbor_top:
  999. .. rst-class:: classref-property
  1000. :ref:`NodePath<class_NodePath>` **focus_neighbor_top** = ``NodePath("")`` :ref:`🔗<class_Control_property_focus_neighbor_top>`
  1001. .. rst-class:: classref-property-setget
  1002. - |void| **set_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ )
  1003. - :ref:`NodePath<class_NodePath>` **get_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  1004. 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.
  1005. .. rst-class:: classref-item-separator
  1006. ----
  1007. .. _class_Control_property_focus_next:
  1008. .. rst-class:: classref-property
  1009. :ref:`NodePath<class_NodePath>` **focus_next** = ``NodePath("")`` :ref:`🔗<class_Control_property_focus_next>`
  1010. .. rst-class:: classref-property-setget
  1011. - |void| **set_focus_next**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  1012. - :ref:`NodePath<class_NodePath>` **get_focus_next**\ (\ )
  1013. 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.
  1014. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
  1015. .. rst-class:: classref-item-separator
  1016. ----
  1017. .. _class_Control_property_focus_previous:
  1018. .. rst-class:: classref-property
  1019. :ref:`NodePath<class_NodePath>` **focus_previous** = ``NodePath("")`` :ref:`🔗<class_Control_property_focus_previous>`
  1020. .. rst-class:: classref-property-setget
  1021. - |void| **set_focus_previous**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  1022. - :ref:`NodePath<class_NodePath>` **get_focus_previous**\ (\ )
  1023. 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.
  1024. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
  1025. .. rst-class:: classref-item-separator
  1026. ----
  1027. .. _class_Control_property_global_position:
  1028. .. rst-class:: classref-property
  1029. :ref:`Vector2<class_Vector2>` **global_position** :ref:`🔗<class_Control_property_global_position>`
  1030. .. rst-class:: classref-property-setget
  1031. - :ref:`Vector2<class_Vector2>` **get_global_position**\ (\ )
  1032. The node's global position, relative to the world (usually to the :ref:`CanvasLayer<class_CanvasLayer>`).
  1033. .. rst-class:: classref-item-separator
  1034. ----
  1035. .. _class_Control_property_grow_horizontal:
  1036. .. rst-class:: classref-property
  1037. :ref:`GrowDirection<enum_Control_GrowDirection>` **grow_horizontal** = ``1`` :ref:`🔗<class_Control_property_grow_horizontal>`
  1038. .. rst-class:: classref-property-setget
  1039. - |void| **set_h_grow_direction**\ (\ value\: :ref:`GrowDirection<enum_Control_GrowDirection>`\ )
  1040. - :ref:`GrowDirection<enum_Control_GrowDirection>` **get_h_grow_direction**\ (\ )
  1041. 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.
  1042. .. rst-class:: classref-item-separator
  1043. ----
  1044. .. _class_Control_property_grow_vertical:
  1045. .. rst-class:: classref-property
  1046. :ref:`GrowDirection<enum_Control_GrowDirection>` **grow_vertical** = ``1`` :ref:`🔗<class_Control_property_grow_vertical>`
  1047. .. rst-class:: classref-property-setget
  1048. - |void| **set_v_grow_direction**\ (\ value\: :ref:`GrowDirection<enum_Control_GrowDirection>`\ )
  1049. - :ref:`GrowDirection<enum_Control_GrowDirection>` **get_v_grow_direction**\ (\ )
  1050. 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.
  1051. .. rst-class:: classref-item-separator
  1052. ----
  1053. .. _class_Control_property_layout_direction:
  1054. .. rst-class:: classref-property
  1055. :ref:`LayoutDirection<enum_Control_LayoutDirection>` **layout_direction** = ``0`` :ref:`🔗<class_Control_property_layout_direction>`
  1056. .. rst-class:: classref-property-setget
  1057. - |void| **set_layout_direction**\ (\ value\: :ref:`LayoutDirection<enum_Control_LayoutDirection>`\ )
  1058. - :ref:`LayoutDirection<enum_Control_LayoutDirection>` **get_layout_direction**\ (\ )
  1059. 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>`.
  1060. .. rst-class:: classref-item-separator
  1061. ----
  1062. .. _class_Control_property_localize_numeral_system:
  1063. .. rst-class:: classref-property
  1064. :ref:`bool<class_bool>` **localize_numeral_system** = ``true`` :ref:`🔗<class_Control_property_localize_numeral_system>`
  1065. .. rst-class:: classref-property-setget
  1066. - |void| **set_localize_numeral_system**\ (\ value\: :ref:`bool<class_bool>`\ )
  1067. - :ref:`bool<class_bool>` **is_localizing_numeral_system**\ (\ )
  1068. 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.
  1069. \ **Note:** Numbers within the text are not automatically converted, it can be done manually, using :ref:`TextServer.format_number()<class_TextServer_method_format_number>`.
  1070. .. rst-class:: classref-item-separator
  1071. ----
  1072. .. _class_Control_property_mouse_behavior_recursive:
  1073. .. rst-class:: classref-property
  1074. :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` **mouse_behavior_recursive** = ``0`` :ref:`🔗<class_Control_property_mouse_behavior_recursive>`
  1075. .. rst-class:: classref-property-setget
  1076. - |void| **set_mouse_behavior_recursive**\ (\ value\: :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>`\ )
  1077. - :ref:`MouseBehaviorRecursive<enum_Control_MouseBehaviorRecursive>` **get_mouse_behavior_recursive**\ (\ )
  1078. 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.
  1079. .. rst-class:: classref-item-separator
  1080. ----
  1081. .. _class_Control_property_mouse_default_cursor_shape:
  1082. .. rst-class:: classref-property
  1083. :ref:`CursorShape<enum_Control_CursorShape>` **mouse_default_cursor_shape** = ``0`` :ref:`🔗<class_Control_property_mouse_default_cursor_shape>`
  1084. .. rst-class:: classref-property-setget
  1085. - |void| **set_default_cursor_shape**\ (\ value\: :ref:`CursorShape<enum_Control_CursorShape>`\ )
  1086. - :ref:`CursorShape<enum_Control_CursorShape>` **get_default_cursor_shape**\ (\ )
  1087. The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors.
  1088. \ **Note:** On Linux, shapes may vary depending on the cursor theme of the system.
  1089. .. rst-class:: classref-item-separator
  1090. ----
  1091. .. _class_Control_property_mouse_filter:
  1092. .. rst-class:: classref-property
  1093. :ref:`MouseFilter<enum_Control_MouseFilter>` **mouse_filter** = ``0`` :ref:`🔗<class_Control_property_mouse_filter>`
  1094. .. rst-class:: classref-property-setget
  1095. - |void| **set_mouse_filter**\ (\ value\: :ref:`MouseFilter<enum_Control_MouseFilter>`\ )
  1096. - :ref:`MouseFilter<enum_Control_MouseFilter>` **get_mouse_filter**\ (\ )
  1097. 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.
  1098. .. rst-class:: classref-item-separator
  1099. ----
  1100. .. _class_Control_property_mouse_force_pass_scroll_events:
  1101. .. rst-class:: classref-property
  1102. :ref:`bool<class_bool>` **mouse_force_pass_scroll_events** = ``true`` :ref:`🔗<class_Control_property_mouse_force_pass_scroll_events>`
  1103. .. rst-class:: classref-property-setget
  1104. - |void| **set_force_pass_scroll_events**\ (\ value\: :ref:`bool<class_bool>`\ )
  1105. - :ref:`bool<class_bool>` **is_force_pass_scroll_events**\ (\ )
  1106. 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>`.
  1107. 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.
  1108. \ **Note:** Because this property defaults to ``true``, this allows nested scrollable containers to work out of the box.
  1109. .. rst-class:: classref-item-separator
  1110. ----
  1111. .. _class_Control_property_offset_bottom:
  1112. .. rst-class:: classref-property
  1113. :ref:`float<class_float>` **offset_bottom** = ``0.0`` :ref:`🔗<class_Control_property_offset_bottom>`
  1114. .. rst-class:: classref-property-setget
  1115. - |void| **set_offset**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ )
  1116. - :ref:`float<class_float>` **get_offset**\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  1117. Distance between the node's bottom edge and its parent control, based on :ref:`anchor_bottom<class_Control_property_anchor_bottom>`.
  1118. 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.
  1119. .. rst-class:: classref-item-separator
  1120. ----
  1121. .. _class_Control_property_offset_left:
  1122. .. rst-class:: classref-property
  1123. :ref:`float<class_float>` **offset_left** = ``0.0`` :ref:`🔗<class_Control_property_offset_left>`
  1124. .. rst-class:: classref-property-setget
  1125. - |void| **set_offset**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ )
  1126. - :ref:`float<class_float>` **get_offset**\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  1127. Distance between the node's left edge and its parent control, based on :ref:`anchor_left<class_Control_property_anchor_left>`.
  1128. 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.
  1129. .. rst-class:: classref-item-separator
  1130. ----
  1131. .. _class_Control_property_offset_right:
  1132. .. rst-class:: classref-property
  1133. :ref:`float<class_float>` **offset_right** = ``0.0`` :ref:`🔗<class_Control_property_offset_right>`
  1134. .. rst-class:: classref-property-setget
  1135. - |void| **set_offset**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ )
  1136. - :ref:`float<class_float>` **get_offset**\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  1137. Distance between the node's right edge and its parent control, based on :ref:`anchor_right<class_Control_property_anchor_right>`.
  1138. 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.
  1139. .. rst-class:: classref-item-separator
  1140. ----
  1141. .. _class_Control_property_offset_top:
  1142. .. rst-class:: classref-property
  1143. :ref:`float<class_float>` **offset_top** = ``0.0`` :ref:`🔗<class_Control_property_offset_top>`
  1144. .. rst-class:: classref-property-setget
  1145. - |void| **set_offset**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ )
  1146. - :ref:`float<class_float>` **get_offset**\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  1147. Distance between the node's top edge and its parent control, based on :ref:`anchor_top<class_Control_property_anchor_top>`.
  1148. 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.
  1149. .. rst-class:: classref-item-separator
  1150. ----
  1151. .. _class_Control_property_pivot_offset:
  1152. .. rst-class:: classref-property
  1153. :ref:`Vector2<class_Vector2>` **pivot_offset** = ``Vector2(0, 0)`` :ref:`🔗<class_Control_property_pivot_offset>`
  1154. .. rst-class:: classref-property-setget
  1155. - |void| **set_pivot_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  1156. - :ref:`Vector2<class_Vector2>` **get_pivot_offset**\ (\ )
  1157. 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.
  1158. The actual offset is the combined value of this property and :ref:`pivot_offset_ratio<class_Control_property_pivot_offset_ratio>`.
  1159. .. rst-class:: classref-item-separator
  1160. ----
  1161. .. _class_Control_property_pivot_offset_ratio:
  1162. .. rst-class:: classref-property
  1163. :ref:`Vector2<class_Vector2>` **pivot_offset_ratio** = ``Vector2(0, 0)`` :ref:`🔗<class_Control_property_pivot_offset_ratio>`
  1164. .. rst-class:: classref-property-setget
  1165. - |void| **set_pivot_offset_ratio**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  1166. - :ref:`Vector2<class_Vector2>` **get_pivot_offset_ratio**\ (\ )
  1167. Same as :ref:`pivot_offset<class_Control_property_pivot_offset>`, but expressed as uniform vector, where ``Vector2(0, 0)`` is the top-left corner of this control, and ``Vector2(1, 1)`` is its bottom-right corner. Set this property to ``Vector2(0.5, 0.5)`` to pivot around this control's center.
  1168. The actual offset is the combined value of this property and :ref:`pivot_offset<class_Control_property_pivot_offset>`.
  1169. .. rst-class:: classref-item-separator
  1170. ----
  1171. .. _class_Control_property_position:
  1172. .. rst-class:: classref-property
  1173. :ref:`Vector2<class_Vector2>` **position** = ``Vector2(0, 0)`` :ref:`🔗<class_Control_property_position>`
  1174. .. rst-class:: classref-property-setget
  1175. - :ref:`Vector2<class_Vector2>` **get_position**\ (\ )
  1176. 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>`.
  1177. .. rst-class:: classref-item-separator
  1178. ----
  1179. .. _class_Control_property_rotation:
  1180. .. rst-class:: classref-property
  1181. :ref:`float<class_float>` **rotation** = ``0.0`` :ref:`🔗<class_Control_property_rotation>`
  1182. .. rst-class:: classref-property-setget
  1183. - |void| **set_rotation**\ (\ value\: :ref:`float<class_float>`\ )
  1184. - :ref:`float<class_float>` **get_rotation**\ (\ )
  1185. The node's rotation around its pivot, in radians. See :ref:`pivot_offset<class_Control_property_pivot_offset>` to change the pivot's position.
  1186. \ **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>`.
  1187. .. rst-class:: classref-item-separator
  1188. ----
  1189. .. _class_Control_property_rotation_degrees:
  1190. .. rst-class:: classref-property
  1191. :ref:`float<class_float>` **rotation_degrees** :ref:`🔗<class_Control_property_rotation_degrees>`
  1192. .. rst-class:: classref-property-setget
  1193. - |void| **set_rotation_degrees**\ (\ value\: :ref:`float<class_float>`\ )
  1194. - :ref:`float<class_float>` **get_rotation_degrees**\ (\ )
  1195. Helper property to access :ref:`rotation<class_Control_property_rotation>` in degrees instead of radians.
  1196. .. rst-class:: classref-item-separator
  1197. ----
  1198. .. _class_Control_property_scale:
  1199. .. rst-class:: classref-property
  1200. :ref:`Vector2<class_Vector2>` **scale** = ``Vector2(1, 1)`` :ref:`🔗<class_Control_property_scale>`
  1201. .. rst-class:: classref-property-setget
  1202. - |void| **set_scale**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  1203. - :ref:`Vector2<class_Vector2>` **get_scale**\ (\ )
  1204. 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.
  1205. \ **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.
  1206. \ **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.
  1207. \ **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.
  1208. .. rst-class:: classref-item-separator
  1209. ----
  1210. .. _class_Control_property_shortcut_context:
  1211. .. rst-class:: classref-property
  1212. :ref:`Node<class_Node>` **shortcut_context** :ref:`🔗<class_Control_property_shortcut_context>`
  1213. .. rst-class:: classref-property-setget
  1214. - |void| **set_shortcut_context**\ (\ value\: :ref:`Node<class_Node>`\ )
  1215. - :ref:`Node<class_Node>` **get_shortcut_context**\ (\ )
  1216. 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.
  1217. .. rst-class:: classref-item-separator
  1218. ----
  1219. .. _class_Control_property_size:
  1220. .. rst-class:: classref-property
  1221. :ref:`Vector2<class_Vector2>` **size** = ``Vector2(0, 0)`` :ref:`🔗<class_Control_property_size>`
  1222. .. rst-class:: classref-property-setget
  1223. - :ref:`Vector2<class_Vector2>` **get_size**\ (\ )
  1224. The size of the node's bounding rectangle, in the node's coordinate system. :ref:`Container<class_Container>` nodes update this property automatically.
  1225. .. rst-class:: classref-item-separator
  1226. ----
  1227. .. _class_Control_property_size_flags_horizontal:
  1228. .. rst-class:: classref-property
  1229. |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] **size_flags_horizontal** = ``1`` :ref:`🔗<class_Control_property_size_flags_horizontal>`
  1230. .. rst-class:: classref-property-setget
  1231. - |void| **set_h_size_flags**\ (\ value\: |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\]\ )
  1232. - |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] **get_h_size_flags**\ (\ )
  1233. 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.
  1234. .. rst-class:: classref-item-separator
  1235. ----
  1236. .. _class_Control_property_size_flags_stretch_ratio:
  1237. .. rst-class:: classref-property
  1238. :ref:`float<class_float>` **size_flags_stretch_ratio** = ``1.0`` :ref:`🔗<class_Control_property_size_flags_stretch_ratio>`
  1239. .. rst-class:: classref-property-setget
  1240. - |void| **set_stretch_ratio**\ (\ value\: :ref:`float<class_float>`\ )
  1241. - :ref:`float<class_float>` **get_stretch_ratio**\ (\ )
  1242. 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.
  1243. .. rst-class:: classref-item-separator
  1244. ----
  1245. .. _class_Control_property_size_flags_vertical:
  1246. .. rst-class:: classref-property
  1247. |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] **size_flags_vertical** = ``1`` :ref:`🔗<class_Control_property_size_flags_vertical>`
  1248. .. rst-class:: classref-property-setget
  1249. - |void| **set_v_size_flags**\ (\ value\: |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\]\ )
  1250. - |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] **get_v_size_flags**\ (\ )
  1251. 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.
  1252. .. rst-class:: classref-item-separator
  1253. ----
  1254. .. _class_Control_property_theme:
  1255. .. rst-class:: classref-property
  1256. :ref:`Theme<class_Theme>` **theme** :ref:`🔗<class_Control_property_theme>`
  1257. .. rst-class:: classref-property-setget
  1258. - |void| **set_theme**\ (\ value\: :ref:`Theme<class_Theme>`\ )
  1259. - :ref:`Theme<class_Theme>` **get_theme**\ (\ )
  1260. 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.
  1261. \ **Note:** :ref:`Window<class_Window>` styles will have no effect unless the window is embedded.
  1262. .. rst-class:: classref-item-separator
  1263. ----
  1264. .. _class_Control_property_theme_type_variation:
  1265. .. rst-class:: classref-property
  1266. :ref:`StringName<class_StringName>` **theme_type_variation** = ``&""`` :ref:`🔗<class_Control_property_theme_type_variation>`
  1267. .. rst-class:: classref-property-setget
  1268. - |void| **set_theme_type_variation**\ (\ value\: :ref:`StringName<class_StringName>`\ )
  1269. - :ref:`StringName<class_StringName>` **get_theme_type_variation**\ (\ )
  1270. 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).
  1271. 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.
  1272. \ **Note:** To look up **Control**'s own items use various ``get_theme_*`` methods without specifying ``theme_type``.
  1273. \ **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.
  1274. .. rst-class:: classref-item-separator
  1275. ----
  1276. .. _class_Control_property_tooltip_auto_translate_mode:
  1277. .. rst-class:: classref-property
  1278. :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` **tooltip_auto_translate_mode** = ``0`` :ref:`🔗<class_Control_property_tooltip_auto_translate_mode>`
  1279. .. rst-class:: classref-property-setget
  1280. - |void| **set_tooltip_auto_translate_mode**\ (\ value\: :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>`\ )
  1281. - :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` **get_tooltip_auto_translate_mode**\ (\ )
  1282. 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>`.
  1283. \ **Note:** Tooltips customized using :ref:`_make_custom_tooltip()<class_Control_private_method__make_custom_tooltip>` do not use this auto translate mode automatically.
  1284. .. rst-class:: classref-item-separator
  1285. ----
  1286. .. _class_Control_property_tooltip_text:
  1287. .. rst-class:: classref-property
  1288. :ref:`String<class_String>` **tooltip_text** = ``""`` :ref:`🔗<class_Control_property_tooltip_text>`
  1289. .. rst-class:: classref-property-setget
  1290. - |void| **set_tooltip_text**\ (\ value\: :ref:`String<class_String>`\ )
  1291. - :ref:`String<class_String>` **get_tooltip_text**\ (\ )
  1292. 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.
  1293. 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.
  1294. 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:
  1295. .. tabs::
  1296. .. code-tab:: gdscript
  1297. var style_box = StyleBoxFlat.new()
  1298. style_box.set_bg_color(Color(1, 1, 0))
  1299. style_box.set_border_width_all(2)
  1300. # We assume here that the `theme` property has been assigned a custom Theme beforehand.
  1301. theme.set_stylebox("panel", "TooltipPanel", style_box)
  1302. theme.set_color("font_color", "TooltipLabel", Color(0, 1, 1))
  1303. .. code-tab:: csharp
  1304. var styleBox = new StyleBoxFlat();
  1305. styleBox.SetBgColor(new Color(1, 1, 0));
  1306. styleBox.SetBorderWidthAll(2);
  1307. // We assume here that the `Theme` property has been assigned a custom Theme beforehand.
  1308. Theme.SetStyleBox("panel", "TooltipPanel", styleBox);
  1309. Theme.SetColor("font_color", "TooltipLabel", new Color(0, 1, 1));
  1310. .. rst-class:: classref-section-separator
  1311. ----
  1312. .. rst-class:: classref-descriptions-group
  1313. Method Descriptions
  1314. -------------------
  1315. .. _class_Control_private_method__accessibility_get_contextual_info:
  1316. .. rst-class:: classref-method
  1317. :ref:`String<class_String>` **_accessibility_get_contextual_info**\ (\ ) |virtual| |const| :ref:`🔗<class_Control_private_method__accessibility_get_contextual_info>`
  1318. Return the description of the keyboard shortcuts and other contextual help for this control.
  1319. .. rst-class:: classref-item-separator
  1320. ----
  1321. .. _class_Control_private_method__can_drop_data:
  1322. .. rst-class:: classref-method
  1323. :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>`
  1324. 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.
  1325. This method should only be used to test the data. Process the data in :ref:`_drop_data()<class_Control_private_method__drop_data>`.
  1326. \ **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.
  1327. .. tabs::
  1328. .. code-tab:: gdscript
  1329. func _can_drop_data(position, data):
  1330. # Check position if it is relevant to you
  1331. # Otherwise, just check data
  1332. return typeof(data) == TYPE_DICTIONARY and data.has("expected")
  1333. .. code-tab:: csharp
  1334. public override bool _CanDropData(Vector2 atPosition, Variant data)
  1335. {
  1336. // Check position if it is relevant to you
  1337. // Otherwise, just check data
  1338. return data.VariantType == Variant.Type.Dictionary && data.AsGodotDictionary().ContainsKey("expected");
  1339. }
  1340. .. rst-class:: classref-item-separator
  1341. ----
  1342. .. _class_Control_private_method__drop_data:
  1343. .. rst-class:: classref-method
  1344. |void| **_drop_data**\ (\ at_position\: :ref:`Vector2<class_Vector2>`, data\: :ref:`Variant<class_Variant>`\ ) |virtual| :ref:`🔗<class_Control_private_method__drop_data>`
  1345. 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.
  1346. \ **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.
  1347. .. tabs::
  1348. .. code-tab:: gdscript
  1349. func _can_drop_data(position, data):
  1350. return typeof(data) == TYPE_DICTIONARY and data.has("color")
  1351. func _drop_data(position, data):
  1352. var color = data["color"]
  1353. .. code-tab:: csharp
  1354. public override bool _CanDropData(Vector2 atPosition, Variant data)
  1355. {
  1356. return data.VariantType == Variant.Type.Dictionary && data.AsGodotDictionary().ContainsKey("color");
  1357. }
  1358. public override void _DropData(Vector2 atPosition, Variant data)
  1359. {
  1360. Color color = data.AsGodotDictionary()["color"].AsColor();
  1361. }
  1362. .. rst-class:: classref-item-separator
  1363. ----
  1364. .. _class_Control_private_method__get_accessibility_container_name:
  1365. .. rst-class:: classref-method
  1366. :ref:`String<class_String>` **_get_accessibility_container_name**\ (\ node\: :ref:`Node<class_Node>`\ ) |virtual| |const| :ref:`🔗<class_Control_private_method__get_accessibility_container_name>`
  1367. 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>`.
  1368. .. rst-class:: classref-item-separator
  1369. ----
  1370. .. _class_Control_private_method__get_drag_data:
  1371. .. rst-class:: classref-method
  1372. :ref:`Variant<class_Variant>` **_get_drag_data**\ (\ at_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| :ref:`🔗<class_Control_private_method__get_drag_data>`
  1373. 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>`.
  1374. 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.
  1375. \ **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.
  1376. .. tabs::
  1377. .. code-tab:: gdscript
  1378. func _get_drag_data(position):
  1379. var mydata = make_data() # This is your custom method generating the drag data.
  1380. set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview of the drag data.
  1381. return mydata
  1382. .. code-tab:: csharp
  1383. public override Variant _GetDragData(Vector2 atPosition)
  1384. {
  1385. var myData = MakeData(); // This is your custom method generating the drag data.
  1386. SetDragPreview(MakePreview(myData)); // This is your custom method generating the preview of the drag data.
  1387. return myData;
  1388. }
  1389. .. rst-class:: classref-item-separator
  1390. ----
  1391. .. _class_Control_private_method__get_minimum_size:
  1392. .. rst-class:: classref-method
  1393. :ref:`Vector2<class_Vector2>` **_get_minimum_size**\ (\ ) |virtual| |const| :ref:`🔗<class_Control_private_method__get_minimum_size>`
  1394. 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).
  1395. If not overridden, defaults to :ref:`Vector2.ZERO<class_Vector2_constant_ZERO>`.
  1396. \ **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.
  1397. .. rst-class:: classref-item-separator
  1398. ----
  1399. .. _class_Control_private_method__get_tooltip:
  1400. .. rst-class:: classref-method
  1401. :ref:`String<class_String>` **_get_tooltip**\ (\ at_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |const| :ref:`🔗<class_Control_private_method__get_tooltip>`
  1402. 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>`.
  1403. \ **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.
  1404. .. rst-class:: classref-item-separator
  1405. ----
  1406. .. _class_Control_private_method__gui_input:
  1407. .. rst-class:: classref-method
  1408. |void| **_gui_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual| :ref:`🔗<class_Control_private_method__gui_input>`
  1409. 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>`.
  1410. \ **Example:** Click on the control to print a message:
  1411. .. tabs::
  1412. .. code-tab:: gdscript
  1413. func _gui_input(event):
  1414. if event is InputEventMouseButton:
  1415. if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
  1416. print("I've been clicked D:")
  1417. .. code-tab:: csharp
  1418. public override void _GuiInput(InputEvent @event)
  1419. {
  1420. if (@event is InputEventMouseButton mb)
  1421. {
  1422. if (mb.ButtonIndex == MouseButton.Left && mb.Pressed)
  1423. {
  1424. GD.Print("I've been clicked D:");
  1425. }
  1426. }
  1427. }
  1428. If the ``event`` inherits :ref:`InputEventMouse<class_InputEventMouse>`, this method will **not** be called when:
  1429. - the control's :ref:`mouse_filter<class_Control_property_mouse_filter>` is set to :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>`;
  1430. - 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>`;
  1431. - 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;
  1432. - 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;
  1433. - the ``event``'s position is outside the control (see :ref:`_has_point()<class_Control_private_method__has_point>`).
  1434. \ **Note:** The ``event``'s position is relative to this control's origin.
  1435. .. rst-class:: classref-item-separator
  1436. ----
  1437. .. _class_Control_private_method__has_point:
  1438. .. rst-class:: classref-method
  1439. :ref:`bool<class_bool>` **_has_point**\ (\ point\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |const| :ref:`🔗<class_Control_private_method__has_point>`
  1440. Virtual method to be implemented by the user. Returns whether the given ``point`` is inside this control.
  1441. If not overridden, default behavior is checking if the point is within control's Rect.
  1442. \ **Note:** If you want to check if a point is inside the control, you can use ``Rect2(Vector2.ZERO, size).has_point(point)``.
  1443. .. rst-class:: classref-item-separator
  1444. ----
  1445. .. _class_Control_private_method__make_custom_tooltip:
  1446. .. rst-class:: classref-method
  1447. :ref:`Object<class_Object>` **_make_custom_tooltip**\ (\ for_text\: :ref:`String<class_String>`\ ) |virtual| |const| :ref:`🔗<class_Control_private_method__make_custom_tooltip>`
  1448. 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>`.
  1449. 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.
  1450. 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).
  1451. \ **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.
  1452. \ **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.
  1453. \ **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.
  1454. \ **Example:** Use a constructed node as a tooltip:
  1455. .. tabs::
  1456. .. code-tab:: gdscript
  1457. func _make_custom_tooltip(for_text):
  1458. var label = Label.new()
  1459. label.text = for_text
  1460. return label
  1461. .. code-tab:: csharp
  1462. public override Control _MakeCustomTooltip(string forText)
  1463. {
  1464. var label = new Label();
  1465. label.Text = forText;
  1466. return label;
  1467. }
  1468. \ **Example:** Use a scene instance as a tooltip:
  1469. .. tabs::
  1470. .. code-tab:: gdscript
  1471. func _make_custom_tooltip(for_text):
  1472. var tooltip = preload("res://some_tooltip_scene.tscn").instantiate()
  1473. tooltip.get_node("Label").text = for_text
  1474. return tooltip
  1475. .. code-tab:: csharp
  1476. public override Control _MakeCustomTooltip(string forText)
  1477. {
  1478. Node tooltip = ResourceLoader.Load<PackedScene>("res://some_tooltip_scene.tscn").Instantiate();
  1479. tooltip.GetNode<Label>("Label").Text = forText;
  1480. return tooltip;
  1481. }
  1482. .. rst-class:: classref-item-separator
  1483. ----
  1484. .. _class_Control_private_method__structured_text_parser:
  1485. .. rst-class:: classref-method
  1486. :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>`
  1487. User defined BiDi algorithm override function.
  1488. 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.
  1489. .. rst-class:: classref-item-separator
  1490. ----
  1491. .. _class_Control_method_accept_event:
  1492. .. rst-class:: classref-method
  1493. |void| **accept_event**\ (\ ) :ref:`🔗<class_Control_method_accept_event>`
  1494. 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>`.
  1495. \ **Note:** This does not affect the methods in :ref:`Input<class_Input>`, only the way events are propagated.
  1496. .. rst-class:: classref-item-separator
  1497. ----
  1498. .. _class_Control_method_accessibility_drag:
  1499. .. rst-class:: classref-method
  1500. |void| **accessibility_drag**\ (\ ) :ref:`🔗<class_Control_method_accessibility_drag>`
  1501. Starts drag-and-drop operation without using a mouse.
  1502. .. rst-class:: classref-item-separator
  1503. ----
  1504. .. _class_Control_method_accessibility_drop:
  1505. .. rst-class:: classref-method
  1506. |void| **accessibility_drop**\ (\ ) :ref:`🔗<class_Control_method_accessibility_drop>`
  1507. Ends drag-and-drop operation without using a mouse.
  1508. .. rst-class:: classref-item-separator
  1509. ----
  1510. .. _class_Control_method_add_theme_color_override:
  1511. .. rst-class:: classref-method
  1512. |void| **add_theme_color_override**\ (\ name\: :ref:`StringName<class_StringName>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Control_method_add_theme_color_override>`
  1513. 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>`.
  1514. See also :ref:`get_theme_color()<class_Control_method_get_theme_color>`.
  1515. \ **Example:** Override a :ref:`Label<class_Label>`'s color and reset it later:
  1516. .. tabs::
  1517. .. code-tab:: gdscript
  1518. # Given the child Label node "MyLabel", override its font color with a custom value.
  1519. $MyLabel.add_theme_color_override("font_color", Color(1, 0.5, 0))
  1520. # Reset the font color of the child label.
  1521. $MyLabel.remove_theme_color_override("font_color")
  1522. # Alternatively it can be overridden with the default value from the Label type.
  1523. $MyLabel.add_theme_color_override("font_color", get_theme_color("font_color", "Label"))
  1524. .. code-tab:: csharp
  1525. // Given the child Label node "MyLabel", override its font color with a custom value.
  1526. GetNode<Label>("MyLabel").AddThemeColorOverride("font_color", new Color(1, 0.5f, 0));
  1527. // Reset the font color of the child label.
  1528. GetNode<Label>("MyLabel").RemoveThemeColorOverride("font_color");
  1529. // Alternatively it can be overridden with the default value from the Label type.
  1530. GetNode<Label>("MyLabel").AddThemeColorOverride("font_color", GetThemeColor("font_color", "Label"));
  1531. .. rst-class:: classref-item-separator
  1532. ----
  1533. .. _class_Control_method_add_theme_constant_override:
  1534. .. rst-class:: classref-method
  1535. |void| **add_theme_constant_override**\ (\ name\: :ref:`StringName<class_StringName>`, constant\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Control_method_add_theme_constant_override>`
  1536. 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>`.
  1537. See also :ref:`get_theme_constant()<class_Control_method_get_theme_constant>`.
  1538. .. rst-class:: classref-item-separator
  1539. ----
  1540. .. _class_Control_method_add_theme_font_override:
  1541. .. rst-class:: classref-method
  1542. |void| **add_theme_font_override**\ (\ name\: :ref:`StringName<class_StringName>`, font\: :ref:`Font<class_Font>`\ ) :ref:`🔗<class_Control_method_add_theme_font_override>`
  1543. 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>`.
  1544. See also :ref:`get_theme_font()<class_Control_method_get_theme_font>`.
  1545. .. rst-class:: classref-item-separator
  1546. ----
  1547. .. _class_Control_method_add_theme_font_size_override:
  1548. .. rst-class:: classref-method
  1549. |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>`
  1550. 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>`.
  1551. See also :ref:`get_theme_font_size()<class_Control_method_get_theme_font_size>`.
  1552. .. rst-class:: classref-item-separator
  1553. ----
  1554. .. _class_Control_method_add_theme_icon_override:
  1555. .. rst-class:: classref-method
  1556. |void| **add_theme_icon_override**\ (\ name\: :ref:`StringName<class_StringName>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_Control_method_add_theme_icon_override>`
  1557. 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>`.
  1558. See also :ref:`get_theme_icon()<class_Control_method_get_theme_icon>`.
  1559. .. rst-class:: classref-item-separator
  1560. ----
  1561. .. _class_Control_method_add_theme_stylebox_override:
  1562. .. rst-class:: classref-method
  1563. |void| **add_theme_stylebox_override**\ (\ name\: :ref:`StringName<class_StringName>`, stylebox\: :ref:`StyleBox<class_StyleBox>`\ ) :ref:`🔗<class_Control_method_add_theme_stylebox_override>`
  1564. 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>`.
  1565. See also :ref:`get_theme_stylebox()<class_Control_method_get_theme_stylebox>`.
  1566. \ **Example:** Modify a property in a :ref:`StyleBox<class_StyleBox>` by duplicating it:
  1567. .. tabs::
  1568. .. code-tab:: gdscript
  1569. # The snippet below assumes the child node "MyButton" has a StyleBoxFlat assigned.
  1570. # Resources are shared across instances, so we need to duplicate it
  1571. # to avoid modifying the appearance of all other buttons.
  1572. var new_stylebox_normal = $MyButton.get_theme_stylebox("normal").duplicate()
  1573. new_stylebox_normal.border_width_top = 3
  1574. new_stylebox_normal.border_color = Color(0, 1, 0.5)
  1575. $MyButton.add_theme_stylebox_override("normal", new_stylebox_normal)
  1576. # Remove the stylebox override.
  1577. $MyButton.remove_theme_stylebox_override("normal")
  1578. .. code-tab:: csharp
  1579. // The snippet below assumes the child node "MyButton" has a StyleBoxFlat assigned.
  1580. // Resources are shared across instances, so we need to duplicate it
  1581. // to avoid modifying the appearance of all other buttons.
  1582. StyleBoxFlat newStyleboxNormal = GetNode<Button>("MyButton").GetThemeStylebox("normal").Duplicate() as StyleBoxFlat;
  1583. newStyleboxNormal.BorderWidthTop = 3;
  1584. newStyleboxNormal.BorderColor = new Color(0, 1, 0.5f);
  1585. GetNode<Button>("MyButton").AddThemeStyleboxOverride("normal", newStyleboxNormal);
  1586. // Remove the stylebox override.
  1587. GetNode<Button>("MyButton").RemoveThemeStyleboxOverride("normal");
  1588. .. rst-class:: classref-item-separator
  1589. ----
  1590. .. _class_Control_method_begin_bulk_theme_override:
  1591. .. rst-class:: classref-method
  1592. |void| **begin_bulk_theme_override**\ (\ ) :ref:`🔗<class_Control_method_begin_bulk_theme_override>`
  1593. 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.
  1594. .. rst-class:: classref-item-separator
  1595. ----
  1596. .. _class_Control_method_end_bulk_theme_override:
  1597. .. rst-class:: classref-method
  1598. |void| **end_bulk_theme_override**\ (\ ) :ref:`🔗<class_Control_method_end_bulk_theme_override>`
  1599. Ends a bulk theme override update. See :ref:`begin_bulk_theme_override()<class_Control_method_begin_bulk_theme_override>`.
  1600. .. rst-class:: classref-item-separator
  1601. ----
  1602. .. _class_Control_method_find_next_valid_focus:
  1603. .. rst-class:: classref-method
  1604. :ref:`Control<class_Control>` **find_next_valid_focus**\ (\ ) |const| :ref:`🔗<class_Control_method_find_next_valid_focus>`
  1605. Finds the next (below in the tree) **Control** that can receive the focus.
  1606. .. rst-class:: classref-item-separator
  1607. ----
  1608. .. _class_Control_method_find_prev_valid_focus:
  1609. .. rst-class:: classref-method
  1610. :ref:`Control<class_Control>` **find_prev_valid_focus**\ (\ ) |const| :ref:`🔗<class_Control_method_find_prev_valid_focus>`
  1611. Finds the previous (above in the tree) **Control** that can receive the focus.
  1612. .. rst-class:: classref-item-separator
  1613. ----
  1614. .. _class_Control_method_find_valid_focus_neighbor:
  1615. .. rst-class:: classref-method
  1616. :ref:`Control<class_Control>` **find_valid_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`🔗<class_Control_method_find_valid_focus_neighbor>`
  1617. Finds the next **Control** that can receive the focus on the specified :ref:`Side<enum_@GlobalScope_Side>`.
  1618. \ **Note:** This is different from :ref:`get_focus_neighbor()<class_Control_method_get_focus_neighbor>`, which returns the path of a specified focus neighbor.
  1619. .. rst-class:: classref-item-separator
  1620. ----
  1621. .. _class_Control_method_force_drag:
  1622. .. rst-class:: classref-method
  1623. |void| **force_drag**\ (\ data\: :ref:`Variant<class_Variant>`, preview\: :ref:`Control<class_Control>`\ ) :ref:`🔗<class_Control_method_force_drag>`
  1624. 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.
  1625. 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.
  1626. .. rst-class:: classref-item-separator
  1627. ----
  1628. .. _class_Control_method_get_anchor:
  1629. .. rst-class:: classref-method
  1630. :ref:`float<class_float>` **get_anchor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`🔗<class_Control_method_get_anchor>`
  1631. 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>`.
  1632. .. rst-class:: classref-item-separator
  1633. ----
  1634. .. _class_Control_method_get_begin:
  1635. .. rst-class:: classref-method
  1636. :ref:`Vector2<class_Vector2>` **get_begin**\ (\ ) |const| :ref:`🔗<class_Control_method_get_begin>`
  1637. 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>`.
  1638. .. rst-class:: classref-item-separator
  1639. ----
  1640. .. _class_Control_method_get_combined_minimum_size:
  1641. .. rst-class:: classref-method
  1642. :ref:`Vector2<class_Vector2>` **get_combined_minimum_size**\ (\ ) |const| :ref:`🔗<class_Control_method_get_combined_minimum_size>`
  1643. 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>`.
  1644. .. rst-class:: classref-item-separator
  1645. ----
  1646. .. _class_Control_method_get_combined_pivot_offset:
  1647. .. rst-class:: classref-method
  1648. :ref:`Vector2<class_Vector2>` **get_combined_pivot_offset**\ (\ ) |const| :ref:`🔗<class_Control_method_get_combined_pivot_offset>`
  1649. Returns the combined value of :ref:`pivot_offset<class_Control_property_pivot_offset>` and :ref:`pivot_offset_ratio<class_Control_property_pivot_offset_ratio>`, in pixels. The ratio is multiplied by the control's size.
  1650. .. rst-class:: classref-item-separator
  1651. ----
  1652. .. _class_Control_method_get_cursor_shape:
  1653. .. rst-class:: classref-method
  1654. :ref:`CursorShape<enum_Control_CursorShape>` **get_cursor_shape**\ (\ position\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) |const| :ref:`🔗<class_Control_method_get_cursor_shape>`
  1655. 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.
  1656. .. rst-class:: classref-item-separator
  1657. ----
  1658. .. _class_Control_method_get_end:
  1659. .. rst-class:: classref-method
  1660. :ref:`Vector2<class_Vector2>` **get_end**\ (\ ) |const| :ref:`🔗<class_Control_method_get_end>`
  1661. Returns :ref:`offset_right<class_Control_property_offset_right>` and :ref:`offset_bottom<class_Control_property_offset_bottom>`.
  1662. .. rst-class:: classref-item-separator
  1663. ----
  1664. .. _class_Control_method_get_focus_mode_with_override:
  1665. .. rst-class:: classref-method
  1666. :ref:`FocusMode<enum_Control_FocusMode>` **get_focus_mode_with_override**\ (\ ) |const| :ref:`🔗<class_Control_method_get_focus_mode_with_override>`
  1667. 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>`.
  1668. .. rst-class:: classref-item-separator
  1669. ----
  1670. .. _class_Control_method_get_focus_neighbor:
  1671. .. rst-class:: classref-method
  1672. :ref:`NodePath<class_NodePath>` **get_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`🔗<class_Control_method_get_focus_neighbor>`
  1673. 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>`.
  1674. \ **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>`.
  1675. .. rst-class:: classref-item-separator
  1676. ----
  1677. .. _class_Control_method_get_global_rect:
  1678. .. rst-class:: classref-method
  1679. :ref:`Rect2<class_Rect2>` **get_global_rect**\ (\ ) |const| :ref:`🔗<class_Control_method_get_global_rect>`
  1680. 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>`.
  1681. \ **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.
  1682. \ **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>`.
  1683. .. rst-class:: classref-item-separator
  1684. ----
  1685. .. _class_Control_method_get_minimum_size:
  1686. .. rst-class:: classref-method
  1687. :ref:`Vector2<class_Vector2>` **get_minimum_size**\ (\ ) |const| :ref:`🔗<class_Control_method_get_minimum_size>`
  1688. Returns the minimum size for this control. See :ref:`custom_minimum_size<class_Control_property_custom_minimum_size>`.
  1689. .. rst-class:: classref-item-separator
  1690. ----
  1691. .. _class_Control_method_get_mouse_filter_with_override:
  1692. .. rst-class:: classref-method
  1693. :ref:`MouseFilter<enum_Control_MouseFilter>` **get_mouse_filter_with_override**\ (\ ) |const| :ref:`🔗<class_Control_method_get_mouse_filter_with_override>`
  1694. 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>`.
  1695. .. rst-class:: classref-item-separator
  1696. ----
  1697. .. _class_Control_method_get_offset:
  1698. .. rst-class:: classref-method
  1699. :ref:`float<class_float>` **get_offset**\ (\ offset\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`🔗<class_Control_method_get_offset>`
  1700. 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>`.
  1701. .. rst-class:: classref-item-separator
  1702. ----
  1703. .. _class_Control_method_get_parent_area_size:
  1704. .. rst-class:: classref-method
  1705. :ref:`Vector2<class_Vector2>` **get_parent_area_size**\ (\ ) |const| :ref:`🔗<class_Control_method_get_parent_area_size>`
  1706. Returns the width/height occupied in the parent control.
  1707. .. rst-class:: classref-item-separator
  1708. ----
  1709. .. _class_Control_method_get_parent_control:
  1710. .. rst-class:: classref-method
  1711. :ref:`Control<class_Control>` **get_parent_control**\ (\ ) |const| :ref:`🔗<class_Control_method_get_parent_control>`
  1712. Returns the parent control node.
  1713. .. rst-class:: classref-item-separator
  1714. ----
  1715. .. _class_Control_method_get_rect:
  1716. .. rst-class:: classref-method
  1717. :ref:`Rect2<class_Rect2>` **get_rect**\ (\ ) |const| :ref:`🔗<class_Control_method_get_rect>`
  1718. 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>`.
  1719. \ **Note:** If :ref:`rotation<class_Control_property_rotation>` is not the default rotation, the resulting size is not meaningful.
  1720. \ **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>`.
  1721. .. rst-class:: classref-item-separator
  1722. ----
  1723. .. _class_Control_method_get_screen_position:
  1724. .. rst-class:: classref-method
  1725. :ref:`Vector2<class_Vector2>` **get_screen_position**\ (\ ) |const| :ref:`🔗<class_Control_method_get_screen_position>`
  1726. Returns the position of this **Control** in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.
  1727. 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>`).
  1728. \ **Example:** Show a popup at the mouse position:
  1729. ::
  1730. popup_menu.position = get_screen_position() + get_local_mouse_position()
  1731. popup_menu.reset_size()
  1732. popup_menu.popup()
  1733. .. rst-class:: classref-item-separator
  1734. ----
  1735. .. _class_Control_method_get_theme_color:
  1736. .. rst-class:: classref-method
  1737. :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>`
  1738. 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.
  1739. 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>`).
  1740. .. tabs::
  1741. .. code-tab:: gdscript
  1742. func _ready():
  1743. # Get the font color defined for the current Control's class, if it exists.
  1744. modulate = get_theme_color("font_color")
  1745. # Get the font color defined for the Button class.
  1746. modulate = get_theme_color("font_color", "Button")
  1747. .. code-tab:: csharp
  1748. public override void _Ready()
  1749. {
  1750. // Get the font color defined for the current Control's class, if it exists.
  1751. Modulate = GetThemeColor("font_color");
  1752. // Get the font color defined for the Button class.
  1753. Modulate = GetThemeColor("font_color", "Button");
  1754. }
  1755. .. rst-class:: classref-item-separator
  1756. ----
  1757. .. _class_Control_method_get_theme_constant:
  1758. .. rst-class:: classref-method
  1759. :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>`
  1760. 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``.
  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_default_base_scale:
  1765. .. rst-class:: classref-method
  1766. :ref:`float<class_float>` **get_theme_default_base_scale**\ (\ ) |const| :ref:`🔗<class_Control_method_get_theme_default_base_scale>`
  1767. 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.
  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_default_font:
  1772. .. rst-class:: classref-method
  1773. :ref:`Font<class_Font>` **get_theme_default_font**\ (\ ) |const| :ref:`🔗<class_Control_method_get_theme_default_font>`
  1774. 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.
  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_default_font_size:
  1779. .. rst-class:: classref-method
  1780. :ref:`int<class_int>` **get_theme_default_font_size**\ (\ ) |const| :ref:`🔗<class_Control_method_get_theme_default_font_size>`
  1781. 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.
  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_font:
  1786. .. rst-class:: classref-method
  1787. :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>`
  1788. 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``.
  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_theme_font_size:
  1793. .. rst-class:: classref-method
  1794. :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>`
  1795. 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``.
  1796. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1797. .. rst-class:: classref-item-separator
  1798. ----
  1799. .. _class_Control_method_get_theme_icon:
  1800. .. rst-class:: classref-method
  1801. :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>`
  1802. 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``.
  1803. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1804. .. rst-class:: classref-item-separator
  1805. ----
  1806. .. _class_Control_method_get_theme_stylebox:
  1807. .. rst-class:: classref-method
  1808. :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>`
  1809. 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``.
  1810. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1811. .. rst-class:: classref-item-separator
  1812. ----
  1813. .. _class_Control_method_get_tooltip:
  1814. .. rst-class:: classref-method
  1815. :ref:`String<class_String>` **get_tooltip**\ (\ at_position\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) |const| :ref:`🔗<class_Control_method_get_tooltip>`
  1816. 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>`.
  1817. This method can be overridden to customize its behavior. See :ref:`_get_tooltip()<class_Control_private_method__get_tooltip>`.
  1818. \ **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.
  1819. .. rst-class:: classref-item-separator
  1820. ----
  1821. .. _class_Control_method_grab_click_focus:
  1822. .. rst-class:: classref-method
  1823. |void| **grab_click_focus**\ (\ ) :ref:`🔗<class_Control_method_grab_click_focus>`
  1824. Creates an :ref:`InputEventMouseButton<class_InputEventMouseButton>` that attempts to click the control. If the event is received, the control gains focus.
  1825. .. tabs::
  1826. .. code-tab:: gdscript
  1827. func _process(delta):
  1828. grab_click_focus() # When clicking another Control node, this node will be clicked instead.
  1829. .. code-tab:: csharp
  1830. public override void _Process(double delta)
  1831. {
  1832. GrabClickFocus(); // When clicking another Control node, this node will be clicked instead.
  1833. }
  1834. .. rst-class:: classref-item-separator
  1835. ----
  1836. .. _class_Control_method_grab_focus:
  1837. .. rst-class:: classref-method
  1838. |void| **grab_focus**\ (\ hide_focus\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Control_method_grab_focus>`
  1839. Steal the focus from another control and become the focused control (see :ref:`focus_mode<class_Control_property_focus_mode>`).
  1840. If ``hide_focus`` is ``true``, the control will not visually show its focused state. Has no effect for :ref:`LineEdit<class_LineEdit>` and :ref:`TextEdit<class_TextEdit>` when :ref:`ProjectSettings.gui/common/show_focus_state_on_pointer_event<class_ProjectSettings_property_gui/common/show_focus_state_on_pointer_event>` is set to ``Control Supports Keyboard Input``, or for any control when it is set to ``Always``.
  1841. \ **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>`.
  1842. .. rst-class:: classref-item-separator
  1843. ----
  1844. .. _class_Control_method_has_focus:
  1845. .. rst-class:: classref-method
  1846. :ref:`bool<class_bool>` **has_focus**\ (\ ignore_hidden_focus\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_Control_method_has_focus>`
  1847. Returns ``true`` if this is the current focused control. See :ref:`focus_mode<class_Control_property_focus_mode>`.
  1848. If ``ignore_hidden_focus`` is ``true``, controls that have their focus hidden will always return ``false``. Hidden focus happens automatically when controls gain focus via mouse input, or manually using :ref:`grab_focus()<class_Control_method_grab_focus>` with ``hide_focus`` set to ``true``.
  1849. .. rst-class:: classref-item-separator
  1850. ----
  1851. .. _class_Control_method_has_theme_color:
  1852. .. rst-class:: classref-method
  1853. :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>`
  1854. 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``.
  1855. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1856. .. rst-class:: classref-item-separator
  1857. ----
  1858. .. _class_Control_method_has_theme_color_override:
  1859. .. rst-class:: classref-method
  1860. :ref:`bool<class_bool>` **has_theme_color_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Control_method_has_theme_color_override>`
  1861. Returns ``true`` if there is a local override for a theme :ref:`Color<class_Color>` with the specified ``name`` in this **Control** node.
  1862. See :ref:`add_theme_color_override()<class_Control_method_add_theme_color_override>`.
  1863. .. rst-class:: classref-item-separator
  1864. ----
  1865. .. _class_Control_method_has_theme_constant:
  1866. .. rst-class:: classref-method
  1867. :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>`
  1868. 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``.
  1869. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1870. .. rst-class:: classref-item-separator
  1871. ----
  1872. .. _class_Control_method_has_theme_constant_override:
  1873. .. rst-class:: classref-method
  1874. :ref:`bool<class_bool>` **has_theme_constant_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Control_method_has_theme_constant_override>`
  1875. Returns ``true`` if there is a local override for a theme constant with the specified ``name`` in this **Control** node.
  1876. See :ref:`add_theme_constant_override()<class_Control_method_add_theme_constant_override>`.
  1877. .. rst-class:: classref-item-separator
  1878. ----
  1879. .. _class_Control_method_has_theme_font:
  1880. .. rst-class:: classref-method
  1881. :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>`
  1882. 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``.
  1883. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1884. .. rst-class:: classref-item-separator
  1885. ----
  1886. .. _class_Control_method_has_theme_font_override:
  1887. .. rst-class:: classref-method
  1888. :ref:`bool<class_bool>` **has_theme_font_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Control_method_has_theme_font_override>`
  1889. Returns ``true`` if there is a local override for a theme :ref:`Font<class_Font>` with the specified ``name`` in this **Control** node.
  1890. See :ref:`add_theme_font_override()<class_Control_method_add_theme_font_override>`.
  1891. .. rst-class:: classref-item-separator
  1892. ----
  1893. .. _class_Control_method_has_theme_font_size:
  1894. .. rst-class:: classref-method
  1895. :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>`
  1896. 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``.
  1897. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1898. .. rst-class:: classref-item-separator
  1899. ----
  1900. .. _class_Control_method_has_theme_font_size_override:
  1901. .. rst-class:: classref-method
  1902. :ref:`bool<class_bool>` **has_theme_font_size_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Control_method_has_theme_font_size_override>`
  1903. Returns ``true`` if there is a local override for a theme font size with the specified ``name`` in this **Control** node.
  1904. See :ref:`add_theme_font_size_override()<class_Control_method_add_theme_font_size_override>`.
  1905. .. rst-class:: classref-item-separator
  1906. ----
  1907. .. _class_Control_method_has_theme_icon:
  1908. .. rst-class:: classref-method
  1909. :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>`
  1910. 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``.
  1911. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1912. .. rst-class:: classref-item-separator
  1913. ----
  1914. .. _class_Control_method_has_theme_icon_override:
  1915. .. rst-class:: classref-method
  1916. :ref:`bool<class_bool>` **has_theme_icon_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Control_method_has_theme_icon_override>`
  1917. Returns ``true`` if there is a local override for a theme icon with the specified ``name`` in this **Control** node.
  1918. See :ref:`add_theme_icon_override()<class_Control_method_add_theme_icon_override>`.
  1919. .. rst-class:: classref-item-separator
  1920. ----
  1921. .. _class_Control_method_has_theme_stylebox:
  1922. .. rst-class:: classref-method
  1923. :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>`
  1924. 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``.
  1925. See :ref:`get_theme_color()<class_Control_method_get_theme_color>` for details.
  1926. .. rst-class:: classref-item-separator
  1927. ----
  1928. .. _class_Control_method_has_theme_stylebox_override:
  1929. .. rst-class:: classref-method
  1930. :ref:`bool<class_bool>` **has_theme_stylebox_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Control_method_has_theme_stylebox_override>`
  1931. Returns ``true`` if there is a local override for a theme :ref:`StyleBox<class_StyleBox>` with the specified ``name`` in this **Control** node.
  1932. See :ref:`add_theme_stylebox_override()<class_Control_method_add_theme_stylebox_override>`.
  1933. .. rst-class:: classref-item-separator
  1934. ----
  1935. .. _class_Control_method_is_drag_successful:
  1936. .. rst-class:: classref-method
  1937. :ref:`bool<class_bool>` **is_drag_successful**\ (\ ) |const| :ref:`🔗<class_Control_method_is_drag_successful>`
  1938. Returns ``true`` if a drag operation is successful. Alternative to :ref:`Viewport.gui_is_drag_successful()<class_Viewport_method_gui_is_drag_successful>`.
  1939. Best used with :ref:`Node.NOTIFICATION_DRAG_END<class_Node_constant_NOTIFICATION_DRAG_END>`.
  1940. .. rst-class:: classref-item-separator
  1941. ----
  1942. .. _class_Control_method_is_layout_rtl:
  1943. .. rst-class:: classref-method
  1944. :ref:`bool<class_bool>` **is_layout_rtl**\ (\ ) |const| :ref:`🔗<class_Control_method_is_layout_rtl>`
  1945. Returns ``true`` if the layout is right-to-left. See also :ref:`layout_direction<class_Control_property_layout_direction>`.
  1946. .. rst-class:: classref-item-separator
  1947. ----
  1948. .. _class_Control_method_release_focus:
  1949. .. rst-class:: classref-method
  1950. |void| **release_focus**\ (\ ) :ref:`🔗<class_Control_method_release_focus>`
  1951. Give up the focus. No other control will be able to receive input.
  1952. .. rst-class:: classref-item-separator
  1953. ----
  1954. .. _class_Control_method_remove_theme_color_override:
  1955. .. rst-class:: classref-method
  1956. |void| **remove_theme_color_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Control_method_remove_theme_color_override>`
  1957. 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.
  1958. .. rst-class:: classref-item-separator
  1959. ----
  1960. .. _class_Control_method_remove_theme_constant_override:
  1961. .. rst-class:: classref-method
  1962. |void| **remove_theme_constant_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Control_method_remove_theme_constant_override>`
  1963. 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.
  1964. .. rst-class:: classref-item-separator
  1965. ----
  1966. .. _class_Control_method_remove_theme_font_override:
  1967. .. rst-class:: classref-method
  1968. |void| **remove_theme_font_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Control_method_remove_theme_font_override>`
  1969. 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.
  1970. .. rst-class:: classref-item-separator
  1971. ----
  1972. .. _class_Control_method_remove_theme_font_size_override:
  1973. .. rst-class:: classref-method
  1974. |void| **remove_theme_font_size_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Control_method_remove_theme_font_size_override>`
  1975. 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.
  1976. .. rst-class:: classref-item-separator
  1977. ----
  1978. .. _class_Control_method_remove_theme_icon_override:
  1979. .. rst-class:: classref-method
  1980. |void| **remove_theme_icon_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Control_method_remove_theme_icon_override>`
  1981. 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.
  1982. .. rst-class:: classref-item-separator
  1983. ----
  1984. .. _class_Control_method_remove_theme_stylebox_override:
  1985. .. rst-class:: classref-method
  1986. |void| **remove_theme_stylebox_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Control_method_remove_theme_stylebox_override>`
  1987. 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.
  1988. .. rst-class:: classref-item-separator
  1989. ----
  1990. .. _class_Control_method_reset_size:
  1991. .. rst-class:: classref-method
  1992. |void| **reset_size**\ (\ ) :ref:`🔗<class_Control_method_reset_size>`
  1993. 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).
  1994. .. rst-class:: classref-item-separator
  1995. ----
  1996. .. _class_Control_method_set_anchor:
  1997. .. rst-class:: classref-method
  1998. |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>`
  1999. 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>`.
  2000. If ``keep_offset`` is ``true``, offsets aren't updated after this operation.
  2001. 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.
  2002. .. rst-class:: classref-item-separator
  2003. ----
  2004. .. _class_Control_method_set_anchor_and_offset:
  2005. .. rst-class:: classref-method
  2006. |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>`
  2007. 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>`).
  2008. .. rst-class:: classref-item-separator
  2009. ----
  2010. .. _class_Control_method_set_anchors_and_offsets_preset:
  2011. .. rst-class:: classref-method
  2012. |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>`
  2013. 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>`.
  2014. .. rst-class:: classref-item-separator
  2015. ----
  2016. .. _class_Control_method_set_anchors_preset:
  2017. .. rst-class:: classref-method
  2018. |void| **set_anchors_preset**\ (\ preset\: :ref:`LayoutPreset<enum_Control_LayoutPreset>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Control_method_set_anchors_preset>`
  2019. 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.
  2020. If ``keep_offsets`` is ``true``, control's position will also be updated.
  2021. .. rst-class:: classref-item-separator
  2022. ----
  2023. .. _class_Control_method_set_begin:
  2024. .. rst-class:: classref-method
  2025. |void| **set_begin**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_Control_method_set_begin>`
  2026. 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>`.
  2027. .. rst-class:: classref-item-separator
  2028. ----
  2029. .. _class_Control_method_set_drag_forwarding:
  2030. .. rst-class:: classref-method
  2031. |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>`
  2032. 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.
  2033. The arguments for each callable should be exactly the same as their respective virtual methods, which would be:
  2034. - ``drag_func`` corresponds to :ref:`_get_drag_data()<class_Control_private_method__get_drag_data>` and requires a :ref:`Vector2<class_Vector2>`;
  2035. - ``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>`;
  2036. - ``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>`.
  2037. .. rst-class:: classref-item-separator
  2038. ----
  2039. .. _class_Control_method_set_drag_preview:
  2040. .. rst-class:: classref-method
  2041. |void| **set_drag_preview**\ (\ control\: :ref:`Control<class_Control>`\ ) :ref:`🔗<class_Control_method_set_drag_preview>`
  2042. 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.
  2043. .. tabs::
  2044. .. code-tab:: gdscript
  2045. @export var color = Color(1, 0, 0, 1)
  2046. func _get_drag_data(position):
  2047. # Use a control that is not in the tree
  2048. var cpb = ColorPickerButton.new()
  2049. cpb.color = color
  2050. cpb.size = Vector2(50, 50)
  2051. set_drag_preview(cpb)
  2052. return color
  2053. .. code-tab:: csharp
  2054. [Export]
  2055. private Color _color = new Color(1, 0, 0, 1);
  2056. public override Variant _GetDragData(Vector2 atPosition)
  2057. {
  2058. // Use a control that is not in the tree
  2059. var cpb = new ColorPickerButton();
  2060. cpb.Color = _color;
  2061. cpb.Size = new Vector2(50, 50);
  2062. SetDragPreview(cpb);
  2063. return _color;
  2064. }
  2065. .. rst-class:: classref-item-separator
  2066. ----
  2067. .. _class_Control_method_set_end:
  2068. .. rst-class:: classref-method
  2069. |void| **set_end**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_Control_method_set_end>`
  2070. Sets :ref:`offset_right<class_Control_property_offset_right>` and :ref:`offset_bottom<class_Control_property_offset_bottom>` at the same time.
  2071. .. rst-class:: classref-item-separator
  2072. ----
  2073. .. _class_Control_method_set_focus_neighbor:
  2074. .. rst-class:: classref-method
  2075. |void| **set_focus_neighbor**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, neighbor\: :ref:`NodePath<class_NodePath>`\ ) :ref:`🔗<class_Control_method_set_focus_neighbor>`
  2076. 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>`.
  2077. .. rst-class:: classref-item-separator
  2078. ----
  2079. .. _class_Control_method_set_global_position:
  2080. .. rst-class:: classref-method
  2081. |void| **set_global_position**\ (\ position\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Control_method_set_global_position>`
  2082. Sets the :ref:`global_position<class_Control_property_global_position>` to given ``position``.
  2083. If ``keep_offsets`` is ``true``, control's anchors will be updated instead of offsets.
  2084. .. rst-class:: classref-item-separator
  2085. ----
  2086. .. _class_Control_method_set_offset:
  2087. .. rst-class:: classref-method
  2088. |void| **set_offset**\ (\ side\: :ref:`Side<enum_@GlobalScope_Side>`, offset\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Control_method_set_offset>`
  2089. 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>`.
  2090. .. rst-class:: classref-item-separator
  2091. ----
  2092. .. _class_Control_method_set_offsets_preset:
  2093. .. rst-class:: classref-method
  2094. |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>`
  2095. 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.
  2096. 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>`.
  2097. Use parameter ``margin`` to determine the gap between the **Control** and the edges.
  2098. .. rst-class:: classref-item-separator
  2099. ----
  2100. .. _class_Control_method_set_position:
  2101. .. rst-class:: classref-method
  2102. |void| **set_position**\ (\ position\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Control_method_set_position>`
  2103. Sets the :ref:`position<class_Control_property_position>` to given ``position``.
  2104. If ``keep_offsets`` is ``true``, control's anchors will be updated instead of offsets.
  2105. .. rst-class:: classref-item-separator
  2106. ----
  2107. .. _class_Control_method_set_size:
  2108. .. rst-class:: classref-method
  2109. |void| **set_size**\ (\ size\: :ref:`Vector2<class_Vector2>`, keep_offsets\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Control_method_set_size>`
  2110. Sets the size (see :ref:`size<class_Control_property_size>`).
  2111. If ``keep_offsets`` is ``true``, control's anchors will be updated instead of offsets.
  2112. .. rst-class:: classref-item-separator
  2113. ----
  2114. .. _class_Control_method_update_minimum_size:
  2115. .. rst-class:: classref-method
  2116. |void| **update_minimum_size**\ (\ ) :ref:`🔗<class_Control_method_update_minimum_size>`
  2117. 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.
  2118. .. rst-class:: classref-item-separator
  2119. ----
  2120. .. _class_Control_method_warp_mouse:
  2121. .. rst-class:: classref-method
  2122. |void| **warp_mouse**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_Control_method_warp_mouse>`
  2123. Moves the mouse cursor to ``position``, relative to :ref:`position<class_Control_property_position>` of this **Control**.
  2124. \ **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.
  2125. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  2126. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  2127. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  2128. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  2129. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  2130. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  2131. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  2132. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  2133. .. |void| replace:: :abbr:`void (No return value.)`