LinkButton.xml 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. Simple button used to represent a link to some resource.
  5. </brief_description>
  6. <description>
  7. This kind of button is primarily used when the interaction with the button causes 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. <methods>
  13. </methods>
  14. <members>
  15. <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="0" />
  16. <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" />
  17. <member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
  18. The button's text that will be displayed inside the button's area.
  19. </member>
  20. <member name="underline" type="int" setter="set_underline_mode" getter="get_underline_mode" enum="LinkButton.UnderlineMode" default="0">
  21. The underline mode to use for the text. See [enum LinkButton.UnderlineMode] for the available modes.
  22. </member>
  23. <member name="uri" type="String" setter="set_uri" getter="get_uri" default="&quot;&quot;">
  24. 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.
  25. [b]Examples:[/b]
  26. [codeblock]
  27. uri = "https://godotengine.org" # Opens the URL in the default web browser.
  28. uri = "C:\SomeFolder" # Opens the file explorer at the given path.
  29. uri = "C:\SomeImage.png" # Opens the given image in the default viewing app.
  30. [/codeblock]
  31. </member>
  32. </members>
  33. <constants>
  34. <constant name="UNDERLINE_MODE_ALWAYS" value="0" enum="UnderlineMode">
  35. The LinkButton will always show an underline at the bottom of its text.
  36. </constant>
  37. <constant name="UNDERLINE_MODE_ON_HOVER" value="1" enum="UnderlineMode">
  38. The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it.
  39. </constant>
  40. <constant name="UNDERLINE_MODE_NEVER" value="2" enum="UnderlineMode">
  41. The LinkButton will never show an underline at the bottom of its text.
  42. </constant>
  43. </constants>
  44. <theme_items>
  45. <theme_item name="font_color" data_type="color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
  46. Default text [Color] of the [LinkButton].
  47. </theme_item>
  48. <theme_item name="font_color_focus" data_type="color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
  49. 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.
  50. </theme_item>
  51. <theme_item name="font_color_hover" data_type="color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
  52. Text [Color] used when the [LinkButton] is being hovered.
  53. </theme_item>
  54. <theme_item name="font_color_pressed" data_type="color" type="Color" default="Color( 1, 1, 1, 1 )">
  55. Text [Color] used when the [LinkButton] is being pressed.
  56. </theme_item>
  57. <theme_item name="underline_spacing" data_type="constant" type="int" default="2">
  58. The vertical space between the baseline of text and the underline.
  59. </theme_item>
  60. <theme_item name="font" data_type="font" type="Font">
  61. [Font] of the [LinkButton]'s text.
  62. </theme_item>
  63. <theme_item name="focus" data_type="style" type="StyleBox">
  64. [StyleBox] used when the [LinkButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect.
  65. </theme_item>
  66. </theme_items>
  67. </class>