LinkButton

Inherits:BaseButton<Control<CanvasItem<Node<Object

A button that represents a link.

Description

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).

See alsoBaseButton which contains common properties and methods associated with this node.

Properties

FocusMode

focus_mode

3 (overridesControl)

String

language

""

CursorShape

mouse_default_cursor_shape

2 (overridesControl)

StructuredTextParser

structured_text_bidi_override

0

Array

structured_text_bidi_override_options

[]

String

text

""

TextDirection

text_direction

0

UnderlineMode

underline

0

String

uri

""

Theme Properties

Color

font_color

Color(0.875,0.875,0.875,1)

Color

font_disabled_color

Color(0,0,0,1)

Color

font_focus_color

Color(0.95,0.95,0.95,1)

Color

font_hover_color

Color(0.95,0.95,0.95,1)

Color

font_hover_pressed_color

Color(0,0,0,1)

Color

font_outline_color

Color(0,0,0,1)

Color

font_pressed_color

Color(1,1,1,1)

int

outline_size

0

int

underline_spacing

2

Font

font

int

font_size

StyleBox

focus


Enumerations

enumUnderlineMode:🔗

UnderlineModeUNDERLINE_MODE_ALWAYS =0

The LinkButton will always show an underline at the bottom of its text.

UnderlineModeUNDERLINE_MODE_ON_HOVER =1

The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it.

UnderlineModeUNDERLINE_MODE_NEVER =2

The LinkButton will never show an underline at the bottom of its text.


Property Descriptions

Stringlanguage =""🔗

Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.


StructuredTextParserstructured_text_bidi_override =0🔗

Set BiDi algorithm override for the structured text.


Arraystructured_text_bidi_override_options =[]🔗

Set additional options for BiDi override.


Stringtext =""🔗

The button's text that will be displayed inside the button's area.


TextDirectiontext_direction =0🔗

Base text writing direction.


UnderlineModeunderline =0🔗

The underline mode to use for the text.


Stringuri =""🔗

TheURI for thisLinkButton. If set to a valid URI, pressing the button opens the URI using the operating system's default program for the protocol (viaOS.shell_open()). HTTP and HTTPS URLs open the default web browser.

uri="https://godotengine.org"# Opens the URL in the default web browser.uri="C:\SomeFolder"# Opens the file explorer at the given path.uri="C:\SomeImage.png"# Opens the given image in the default viewing app.

Theme Property Descriptions

Colorfont_color =Color(0.875,0.875,0.875,1)🔗

Default textColor of theLinkButton.


Colorfont_disabled_color =Color(0,0,0,1)🔗

TextColor used when theLinkButton is disabled.


Colorfont_focus_color =Color(0.95,0.95,0.95,1)🔗

TextColor used when theLinkButton is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.


Colorfont_hover_color =Color(0.95,0.95,0.95,1)🔗

TextColor used when theLinkButton is being hovered.


Colorfont_hover_pressed_color =Color(0,0,0,1)🔗

TextColor used when theLinkButton is being hovered and pressed.


Colorfont_outline_color =Color(0,0,0,1)🔗

The tint of text outline of theLinkButton.


Colorfont_pressed_color =Color(1,1,1,1)🔗

TextColor used when theLinkButton is being pressed.


intoutline_size =0🔗

The size of the text outline.

Note: If using a font withFontFile.multichannel_signed_distance_field enabled, itsFontFile.msdf_pixel_range must be set to at leasttwice the value ofoutline_size for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.


intunderline_spacing =2🔗

The vertical space between the baseline of text and the underline.


Fontfont🔗

Font of theLinkButton's text.


intfont_size🔗

Font size of theLinkButton's text.


StyleBoxfocus🔗

StyleBox used when theLinkButton is focused. ThefocusStyleBox is displayedover the baseStyleBox, so a partially transparentStyleBox should be used to ensure the baseStyleBox remains visible. AStyleBox that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign aStyleBoxEmpty resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.


User-contributed notes

Please read theUser-contributed notes policy before submitting a comment.