Table of Contents

Class LinkButton

A button that represents a link.

Inheritance
LinkButton

Remarks

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 also BaseButton which contains common properties and methods associated with this node.

Properties

language

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

var language : String = ""

Property Value

String

Remarks

structured_text_bidi_override

Set BiDi algorithm override for the structured text.

var structured_text_bidi_override : int = 0

Property Value

int

Remarks

  • void set_structured_text_bidi_override(int value)
  • int get_structured_text_bidi_override

structured_text_bidi_override_options

Set additional options for BiDi override.

var structured_text_bidi_override_options : Array = []

Property Value

Array

Remarks

  • void set_structured_text_bidi_override_options(Array value)
  • Array get_structured_text_bidi_override_options

text

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

var text : String = ""

Property Value

String

Remarks

text_direction

Base text writing direction.

var text_direction : int = 0

Property Value

int

Remarks

  • void set_text_direction(int value)
  • int get_text_direction

underline

The underline mode to use for the text. See UnderlineMode for the available modes.

var underline : int = 0

Property Value

int

Remarks

  • void set_underline_mode(int value)
  • int get_underline_mode

uri

The URI 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 OS.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.

var uri : String = ""

Property Value

String

Remarks

font_color

Theme Property

Default text Color of the LinkButton.

 = ``Color(0.875, 0.875, 0.875, 1)``

Property Value

Color

font_disabled_color

Theme Property

Text Color used when the LinkButton is disabled.

 = ``Color(0, 0, 0, 1)``

Property Value

Color

font_focus_color

Theme Property

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.

 = ``Color(0.95, 0.95, 0.95, 1)``

Property Value

Color

font_hover_color

Theme Property

Text Color used when the LinkButton is being hovered.

 = ``Color(0.95, 0.95, 0.95, 1)``

Property Value

Color

font_hover_pressed_color

Theme Property

Text Color used when the LinkButton is being hovered and pressed.

 = ``Color(0, 0, 0, 1)``

Property Value

Color

font_outline_color

Theme Property

The tint of text outline of the LinkButton.

 = ``Color(0, 0, 0, 1)``

Property Value

Color

font_pressed_color

Theme Property

Text Color used when the LinkButton is being pressed.

 = ``Color(1, 1, 1, 1)``

Property Value

Color

outline_size

Theme Property

The size of the text outline.

Note: If using a font with multichannel_signed_distance_field enabled, its msdf_pixel_range must be set to at least twice the value of outline_size for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.

 = ``0``

Property Value

int

underline_spacing

Theme Property

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

 = ``2``

Property Value

int

font

Theme Property

Font of the LinkButton's text.

Font font

Property Value

Font

font_size

Theme Property

Font size of the LinkButton's text.

int font_size

Property Value

int

focus

Theme Property

StyleBox used when the LinkButton is focused. The focus StyleBox is displayed over 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.

StyleBox focus

Property Value

StyleBox