class_linkbutton.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/LinkButton.xml.
  6. .. _class_LinkButton:
  7. LinkButton
  8. ==========
  9. **Inherits:** :ref:`BaseButton<class_BaseButton>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Simple button used to represent a link to some resource.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This kind of button is primarily used when the interaction with the button causes a context change (like linking to a web page).
  15. See also :ref:`BaseButton<class_BaseButton>` which contains common properties and methods associated with this node.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-----------------------------------------------------+-------------------------------------------------------+-------------------------------------------------------------------------------------+
  22. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``0`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  23. +-----------------------------------------------------+-------------------------------------------------------+-------------------------------------------------------------------------------------+
  24. | :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | ``2`` (overrides :ref:`Control<class_Control_property_mouse_default_cursor_shape>`) |
  25. +-----------------------------------------------------+-------------------------------------------------------+-------------------------------------------------------------------------------------+
  26. | :ref:`String<class_String>` | :ref:`text<class_LinkButton_property_text>` | ``""`` |
  27. +-----------------------------------------------------+-------------------------------------------------------+-------------------------------------------------------------------------------------+
  28. | :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` | :ref:`underline<class_LinkButton_property_underline>` | ``0`` |
  29. +-----------------------------------------------------+-------------------------------------------------------+-------------------------------------------------------------------------------------+
  30. | :ref:`String<class_String>` | :ref:`uri<class_LinkButton_property_uri>` | ``""`` |
  31. +-----------------------------------------------------+-------------------------------------------------------+-------------------------------------------------------------------------------------+
  32. .. rst-class:: classref-reftable-group
  33. Theme Properties
  34. ----------------
  35. .. table::
  36. :widths: auto
  37. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  38. | :ref:`Color<class_Color>` | :ref:`font_color<class_LinkButton_theme_color_font_color>` | ``Color( 0.88, 0.88, 0.88, 1 )`` |
  39. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  40. | :ref:`Color<class_Color>` | :ref:`font_color_focus<class_LinkButton_theme_color_font_color_focus>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  41. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  42. | :ref:`Color<class_Color>` | :ref:`font_color_hover<class_LinkButton_theme_color_font_color_hover>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  43. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  44. | :ref:`Color<class_Color>` | :ref:`font_color_pressed<class_LinkButton_theme_color_font_color_pressed>` | ``Color( 1, 1, 1, 1 )`` |
  45. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  46. | :ref:`int<class_int>` | :ref:`underline_spacing<class_LinkButton_theme_constant_underline_spacing>` | ``2`` |
  47. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  48. | :ref:`Font<class_Font>` | :ref:`font<class_LinkButton_theme_font_font>` | |
  49. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  50. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_LinkButton_theme_style_focus>` | |
  51. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  52. .. rst-class:: classref-section-separator
  53. ----
  54. .. rst-class:: classref-descriptions-group
  55. Enumerations
  56. ------------
  57. .. _enum_LinkButton_UnderlineMode:
  58. .. rst-class:: classref-enumeration
  59. enum **UnderlineMode**:
  60. .. _class_LinkButton_constant_UNDERLINE_MODE_ALWAYS:
  61. .. rst-class:: classref-enumeration-constant
  62. :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` **UNDERLINE_MODE_ALWAYS** = ``0``
  63. The LinkButton will always show an underline at the bottom of its text.
  64. .. _class_LinkButton_constant_UNDERLINE_MODE_ON_HOVER:
  65. .. rst-class:: classref-enumeration-constant
  66. :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` **UNDERLINE_MODE_ON_HOVER** = ``1``
  67. The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it.
  68. .. _class_LinkButton_constant_UNDERLINE_MODE_NEVER:
  69. .. rst-class:: classref-enumeration-constant
  70. :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` **UNDERLINE_MODE_NEVER** = ``2``
  71. The LinkButton will never show an underline at the bottom of its text.
  72. .. rst-class:: classref-section-separator
  73. ----
  74. .. rst-class:: classref-descriptions-group
  75. Property Descriptions
  76. ---------------------
  77. .. _class_LinkButton_property_text:
  78. .. rst-class:: classref-property
  79. :ref:`String<class_String>` **text** = ``""``
  80. .. rst-class:: classref-property-setget
  81. - void **set_text** **(** :ref:`String<class_String>` value **)**
  82. - :ref:`String<class_String>` **get_text** **(** **)**
  83. The button's text that will be displayed inside the button's area.
  84. .. rst-class:: classref-item-separator
  85. ----
  86. .. _class_LinkButton_property_underline:
  87. .. rst-class:: classref-property
  88. :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` **underline** = ``0``
  89. .. rst-class:: classref-property-setget
  90. - void **set_underline_mode** **(** :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` value **)**
  91. - :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` **get_underline_mode** **(** **)**
  92. The underline mode to use for the text. See :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` for the available modes.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_LinkButton_property_uri:
  96. .. rst-class:: classref-property
  97. :ref:`String<class_String>` **uri** = ``""``
  98. .. rst-class:: classref-property-setget
  99. - void **set_uri** **(** :ref:`String<class_String>` value **)**
  100. - :ref:`String<class_String>` **get_uri** **(** **)**
  101. The `URI <https://en.wikipedia.org/wiki/Uniform_Resource_Identifier>`__ for this **LinkButton**. If set to a valid URI, pressing the button opens the URI using the operating system's default program for the protocol (via :ref:`OS.shell_open<class_OS_method_shell_open>`). HTTP and HTTPS URLs open the default web browser.
  102. \ **Examples:**\
  103. ::
  104. uri = "https://godotengine.org" # Opens the URL in the default web browser.
  105. uri = "C:\SomeFolder" # Opens the file explorer at the given path.
  106. uri = "C:\SomeImage.png" # Opens the given image in the default viewing app.
  107. .. rst-class:: classref-section-separator
  108. ----
  109. .. rst-class:: classref-descriptions-group
  110. Theme Property Descriptions
  111. ---------------------------
  112. .. _class_LinkButton_theme_color_font_color:
  113. .. rst-class:: classref-themeproperty
  114. :ref:`Color<class_Color>` **font_color** = ``Color( 0.88, 0.88, 0.88, 1 )``
  115. Default text :ref:`Color<class_Color>` of the **LinkButton**.
  116. .. rst-class:: classref-item-separator
  117. ----
  118. .. _class_LinkButton_theme_color_font_color_focus:
  119. .. rst-class:: classref-themeproperty
  120. :ref:`Color<class_Color>` **font_color_focus** = ``Color( 0.94, 0.94, 0.94, 1 )``
  121. Text :ref:`Color<class_Color>` used when the **LinkButton** is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.
  122. .. rst-class:: classref-item-separator
  123. ----
  124. .. _class_LinkButton_theme_color_font_color_hover:
  125. .. rst-class:: classref-themeproperty
  126. :ref:`Color<class_Color>` **font_color_hover** = ``Color( 0.94, 0.94, 0.94, 1 )``
  127. Text :ref:`Color<class_Color>` used when the **LinkButton** is being hovered.
  128. .. rst-class:: classref-item-separator
  129. ----
  130. .. _class_LinkButton_theme_color_font_color_pressed:
  131. .. rst-class:: classref-themeproperty
  132. :ref:`Color<class_Color>` **font_color_pressed** = ``Color( 1, 1, 1, 1 )``
  133. Text :ref:`Color<class_Color>` used when the **LinkButton** is being pressed.
  134. .. rst-class:: classref-item-separator
  135. ----
  136. .. _class_LinkButton_theme_constant_underline_spacing:
  137. .. rst-class:: classref-themeproperty
  138. :ref:`int<class_int>` **underline_spacing** = ``2``
  139. The vertical space between the baseline of text and the underline.
  140. .. rst-class:: classref-item-separator
  141. ----
  142. .. _class_LinkButton_theme_font_font:
  143. .. rst-class:: classref-themeproperty
  144. :ref:`Font<class_Font>` **font**
  145. :ref:`Font<class_Font>` of the **LinkButton**'s text.
  146. .. rst-class:: classref-item-separator
  147. ----
  148. .. _class_LinkButton_theme_style_focus:
  149. .. rst-class:: classref-themeproperty
  150. :ref:`StyleBox<class_StyleBox>` **focus**
  151. :ref:`StyleBox<class_StyleBox>` used when the **LinkButton** is focused. It is displayed over the current :ref:`StyleBox<class_StyleBox>`, so using :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` will just disable the focus visual effect.
  152. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  153. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  154. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  155. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`