LinkButton.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="LinkButton" inherits="BaseButton" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. A button that represents a link.
  5. </brief_description>
  6. <description>
  7. A button that represents a link. This type of button is primarily used for interactions that cause a context change (like linking to a web page).
  8. See also [BaseButton] which contains common properties and methods associated with this node.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <members>
  13. <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="3" />
  14. <member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
  15. Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  16. </member>
  17. <member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" overrides="Control" enum="Control.CursorShape" default="2" />
  18. <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="TextServer.StructuredTextParser" default="0">
  19. Set BiDi algorithm override for the structured text.
  20. </member>
  21. <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[]">
  22. Set additional options for BiDi override.
  23. </member>
  24. <member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
  25. The button's text that will be displayed inside the button's area.
  26. </member>
  27. <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
  28. Base text writing direction.
  29. </member>
  30. <member name="underline" type="int" setter="set_underline_mode" getter="get_underline_mode" enum="LinkButton.UnderlineMode" default="0">
  31. The underline mode to use for the text.
  32. </member>
  33. <member name="uri" type="String" setter="set_uri" getter="get_uri" default="&quot;&quot;">
  34. The [url=https://en.wikipedia.org/wiki/Uniform_Resource_Identifier]URI[/url] 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 [method OS.shell_open]). HTTP and HTTPS URLs open the default web browser.
  35. [codeblocks]
  36. [gdscript]
  37. uri = "https://godotengine.org" # Opens the URL in the default web browser.
  38. uri = "C:\SomeFolder" # Opens the file explorer at the given path.
  39. uri = "C:\SomeImage.png" # Opens the given image in the default viewing app.
  40. [/gdscript]
  41. [csharp]
  42. Uri = "https://godotengine.org"; // Opens the URL in the default web browser.
  43. Uri = "C:\SomeFolder"; // Opens the file explorer at the given path.
  44. Uri = "C:\SomeImage.png"; // Opens the given image in the default viewing app.
  45. [/csharp]
  46. [/codeblocks]
  47. </member>
  48. </members>
  49. <constants>
  50. <constant name="UNDERLINE_MODE_ALWAYS" value="0" enum="UnderlineMode">
  51. The LinkButton will always show an underline at the bottom of its text.
  52. </constant>
  53. <constant name="UNDERLINE_MODE_ON_HOVER" value="1" enum="UnderlineMode">
  54. The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it.
  55. </constant>
  56. <constant name="UNDERLINE_MODE_NEVER" value="2" enum="UnderlineMode">
  57. The LinkButton will never show an underline at the bottom of its text.
  58. </constant>
  59. </constants>
  60. <theme_items>
  61. <theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
  62. Default text [Color] of the [LinkButton].
  63. </theme_item>
  64. <theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)">
  65. Text [Color] used when the [LinkButton] is disabled.
  66. </theme_item>
  67. <theme_item name="font_focus_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
  68. Text [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.
  69. </theme_item>
  70. <theme_item name="font_hover_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
  71. Text [Color] used when the [LinkButton] is being hovered.
  72. </theme_item>
  73. <theme_item name="font_hover_pressed_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)">
  74. Text [Color] used when the [LinkButton] is being hovered and pressed.
  75. </theme_item>
  76. <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)">
  77. The tint of text outline of the [LinkButton].
  78. </theme_item>
  79. <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
  80. Text [Color] used when the [LinkButton] is being pressed.
  81. </theme_item>
  82. <theme_item name="outline_size" data_type="constant" type="int" default="0">
  83. The size of the text outline.
  84. [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
  85. </theme_item>
  86. <theme_item name="underline_spacing" data_type="constant" type="int" default="2">
  87. The vertical space between the baseline of text and the underline.
  88. </theme_item>
  89. <theme_item name="font" data_type="font" type="Font">
  90. [Font] of the [LinkButton]'s text.
  91. </theme_item>
  92. <theme_item name="font_size" data_type="font_size" type="int">
  93. Font size of the [LinkButton]'s text.
  94. </theme_item>
  95. <theme_item name="focus" data_type="style" type="StyleBox">
  96. [StyleBox] used when the [LinkButton] is focused. The [theme_item focus] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
  97. </theme_item>
  98. </theme_items>
  99. </class>