class_linkbutton.rst 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/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. .. rst-class:: classref-reftable-group
  31. Theme Properties
  32. ----------------
  33. .. table::
  34. :widths: auto
  35. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  36. | :ref:`Color<class_Color>` | :ref:`font_color<class_LinkButton_theme_color_font_color>` | ``Color( 0.88, 0.88, 0.88, 1 )`` |
  37. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  38. | :ref:`Color<class_Color>` | :ref:`font_color_focus<class_LinkButton_theme_color_font_color_focus>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  39. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  40. | :ref:`Color<class_Color>` | :ref:`font_color_hover<class_LinkButton_theme_color_font_color_hover>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  41. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  42. | :ref:`Color<class_Color>` | :ref:`font_color_pressed<class_LinkButton_theme_color_font_color_pressed>` | ``Color( 1, 1, 1, 1 )`` |
  43. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  44. | :ref:`int<class_int>` | :ref:`underline_spacing<class_LinkButton_theme_constant_underline_spacing>` | ``2`` |
  45. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  46. | :ref:`Font<class_Font>` | :ref:`font<class_LinkButton_theme_font_font>` | |
  47. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  48. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_LinkButton_theme_style_focus>` | |
  49. +---------------------------------+-----------------------------------------------------------------------------+----------------------------------+
  50. .. rst-class:: classref-section-separator
  51. ----
  52. .. rst-class:: classref-descriptions-group
  53. Enumerations
  54. ------------
  55. .. _enum_LinkButton_UnderlineMode:
  56. .. rst-class:: classref-enumeration
  57. enum **UnderlineMode**:
  58. .. _class_LinkButton_constant_UNDERLINE_MODE_ALWAYS:
  59. .. rst-class:: classref-enumeration-constant
  60. :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` **UNDERLINE_MODE_ALWAYS** = ``0``
  61. The LinkButton will always show an underline at the bottom of its text.
  62. .. _class_LinkButton_constant_UNDERLINE_MODE_ON_HOVER:
  63. .. rst-class:: classref-enumeration-constant
  64. :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` **UNDERLINE_MODE_ON_HOVER** = ``1``
  65. The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it.
  66. .. _class_LinkButton_constant_UNDERLINE_MODE_NEVER:
  67. .. rst-class:: classref-enumeration-constant
  68. :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` **UNDERLINE_MODE_NEVER** = ``2``
  69. The LinkButton will never show an underline at the bottom of its text.
  70. .. rst-class:: classref-section-separator
  71. ----
  72. .. rst-class:: classref-descriptions-group
  73. Property Descriptions
  74. ---------------------
  75. .. _class_LinkButton_property_text:
  76. .. rst-class:: classref-property
  77. :ref:`String<class_String>` **text** = ``""``
  78. .. rst-class:: classref-property-setget
  79. - void **set_text** **(** :ref:`String<class_String>` value **)**
  80. - :ref:`String<class_String>` **get_text** **(** **)**
  81. The button's text that will be displayed inside the button's area.
  82. .. rst-class:: classref-item-separator
  83. ----
  84. .. _class_LinkButton_property_underline:
  85. .. rst-class:: classref-property
  86. :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` **underline** = ``0``
  87. .. rst-class:: classref-property-setget
  88. - void **set_underline_mode** **(** :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` value **)**
  89. - :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` **get_underline_mode** **(** **)**
  90. Determines when to show the underline. See :ref:`UnderlineMode<enum_LinkButton_UnderlineMode>` for options.
  91. .. rst-class:: classref-section-separator
  92. ----
  93. .. rst-class:: classref-descriptions-group
  94. Theme Property Descriptions
  95. ---------------------------
  96. .. _class_LinkButton_theme_color_font_color:
  97. .. rst-class:: classref-themeproperty
  98. :ref:`Color<class_Color>` **font_color** = ``Color( 0.88, 0.88, 0.88, 1 )``
  99. Default text :ref:`Color<class_Color>` of the **LinkButton**.
  100. .. rst-class:: classref-item-separator
  101. ----
  102. .. _class_LinkButton_theme_color_font_color_focus:
  103. .. rst-class:: classref-themeproperty
  104. :ref:`Color<class_Color>` **font_color_focus** = ``Color( 0.94, 0.94, 0.94, 1 )``
  105. 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.
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _class_LinkButton_theme_color_font_color_hover:
  109. .. rst-class:: classref-themeproperty
  110. :ref:`Color<class_Color>` **font_color_hover** = ``Color( 0.94, 0.94, 0.94, 1 )``
  111. Text :ref:`Color<class_Color>` used when the **LinkButton** is being hovered.
  112. .. rst-class:: classref-item-separator
  113. ----
  114. .. _class_LinkButton_theme_color_font_color_pressed:
  115. .. rst-class:: classref-themeproperty
  116. :ref:`Color<class_Color>` **font_color_pressed** = ``Color( 1, 1, 1, 1 )``
  117. Text :ref:`Color<class_Color>` used when the **LinkButton** is being pressed.
  118. .. rst-class:: classref-item-separator
  119. ----
  120. .. _class_LinkButton_theme_constant_underline_spacing:
  121. .. rst-class:: classref-themeproperty
  122. :ref:`int<class_int>` **underline_spacing** = ``2``
  123. The vertical space between the baseline of text and the underline.
  124. .. rst-class:: classref-item-separator
  125. ----
  126. .. _class_LinkButton_theme_font_font:
  127. .. rst-class:: classref-themeproperty
  128. :ref:`Font<class_Font>` **font**
  129. :ref:`Font<class_Font>` of the **LinkButton**'s text.
  130. .. rst-class:: classref-item-separator
  131. ----
  132. .. _class_LinkButton_theme_style_focus:
  133. .. rst-class:: classref-themeproperty
  134. :ref:`StyleBox<class_StyleBox>` **focus**
  135. :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.
  136. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  137. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  138. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  139. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`