| 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="ellipsis_char" type="String" setter="set_ellipsis_char" getter="get_ellipsis_char" default=""…""> |
| 14 | Ellipsis character used for text clipping. |
| 15 | </member> |
| 16 | <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="3" /> |
| 17 | <member name="language" type="String" setter="set_language" getter="get_language" default=""""> |
| 18 | Language code used for line-breaking and text shaping algorithms. If left empty, the current locale is used instead. |
| 19 | </member> |
| 20 | <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" /> |
| 21 | <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"> |
| 22 | Set BiDi algorithm override for the structured text. |
| 23 | </member> |
| 24 | <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[]"> |
| 25 | Set additional options for BiDi override. |
| 26 | </member> |
| 27 | <member name="text" type="String" setter="set_text" getter="get_text" default=""""> |
| 28 | The button's text that will be displayed inside the button's area. |
| 29 | </member> |
| 30 | <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0"> |
| 31 | Base text writing direction. |
| 32 | </member> |
| 33 | <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextServer.OverrunBehavior" default="0"> |
| 34 | Sets the clipping behavior when the text exceeds the node's bounding rectangle. |
| 35 | </member> |
| 36 | <member name="underline" type="int" setter="set_underline_mode" getter="get_underline_mode" enum="LinkButton.UnderlineMode" default="0"> |
| 37 | The underline mode to use for the text. |
| 38 | </member> |
| 39 | <member name="uri" type="String" setter="set_uri" getter="get_uri" default=""""> |
| 40 | 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. |
| 41 | [codeblocks] |
| 42 | [gdscript] |
| 43 | uri = "https://godotengine.org" # Opens the URL in the default web browser. |
| 44 | uri = "C:\SomeFolder" # Opens the file explorer at the given path. |
| 45 | uri = "C:\SomeImage.png" # Opens the given image in the default viewing app. |
| 46 | [/gdscript] |
| 47 | [csharp] |
| 48 | Uri = "https://godotengine.org"; // Opens the URL in the default web browser. |
| 49 | Uri = "C:\SomeFolder"; // Opens the file explorer at the given path. |
| 50 | Uri = "C:\SomeImage.png"; // Opens the given image in the default viewing app. |
| 51 | [/csharp] |
| 52 | [/codeblocks] |
| 53 | </member> |
| 54 | </members> |
| 55 | <constants> |
| 56 | <constant name="UNDERLINE_MODE_ALWAYS" value="0" enum="UnderlineMode"> |
| 57 | The LinkButton will always show an underline at the bottom of its text. |
| 58 | </constant> |
| 59 | <constant name="UNDERLINE_MODE_ON_HOVER" value="1" enum="UnderlineMode"> |
| 60 | The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it. |
| 61 | </constant> |
| 62 | <constant name="UNDERLINE_MODE_NEVER" value="2" enum="UnderlineMode"> |
| 63 | The LinkButton will never show an underline at the bottom of its text. |
| 64 | </constant> |
| 65 | </constants> |
| 66 | <theme_items> |
| 67 | <theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)"> |
| 68 | Default text [Color] of the [LinkButton]. |
| 69 | </theme_item> |
| 70 | <theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> |
| 71 | Text [Color] used when the [LinkButton] is disabled. |
| 72 | </theme_item> |
| 73 | <theme_item name="font_focus_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)"> |
| 74 | 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. |
| 75 | </theme_item> |
| 76 | <theme_item name="font_hover_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)"> |
| 77 | Text [Color] used when the [LinkButton] is being hovered. |
| 78 | </theme_item> |
| 79 | <theme_item name="font_hover_pressed_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> |
| 80 | Text [Color] used when the [LinkButton] is being hovered and pressed. |
| 81 | </theme_item> |
| 82 | <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> |
| 83 | The tint of text outline of the [LinkButton]. |
| 84 | </theme_item> |
| 85 | <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> |
| 86 | Text [Color] used when the [LinkButton] is being pressed. |
| 87 | </theme_item> |
| 88 | <theme_item name="outline_size" data_type="constant" type="int" default="0"> |
| 89 | The size of the text outline. |
| 90 | [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. |
| 91 | </theme_item> |
| 92 | <theme_item name="underline_spacing" data_type="constant" type="int" default="2"> |
| 93 | The vertical space between the baseline of text and the underline. |
| 94 | </theme_item> |
| 95 | <theme_item name="font" data_type="font" type="Font"> |
| 96 | [Font] of the [LinkButton]'s text. |
| 97 | </theme_item> |
| 98 | <theme_item name="font_size" data_type="font_size" type="int"> |
| 99 | Font size of the [LinkButton]'s text. |
| 100 | </theme_item> |
| 101 | <theme_item name="focus" data_type="style" type="StyleBox"> |
| 102 | [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. |
| 103 | </theme_item> |
| 104 | </theme_items> |
| 105 | </class> |