Class reference

LinkButton

Inherits BaseButton

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

Properties

int focus_mode = 3

String language = ""

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

int mouse_default_cursor_shape = 2

int structured_text_bidi_override = 0

Set BiDi algorithm override for the structured text.

Array structured_text_bidi_override_options = []

Set additional options for BiDi override.

String text = ""

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

int text_direction = 0

Base text writing direction.

int underline = 0

The underline mode to use for the text.

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

Constants

UNDERLINE_MODE_ALWAYS = 0

Enum: UnderlineMode

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

UNDERLINE_MODE_ON_HOVER = 1

Enum: UnderlineMode

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

UNDERLINE_MODE_NEVER = 2

Enum: UnderlineMode

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

Theme properties

Color font_focus_color = Color(0.95, 0.95, 0.95, 1)

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 font_hover_color = Color(0.95, 0.95, 0.95, 1)

Text Color used when the LinkButton is being hovered.

Color font_hover_pressed_color = Color(0, 0, 0, 1)

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

Color font_outline_color = Color(0, 0, 0, 1)

The tint of text outline of the LinkButton.

int underline_spacing = 2

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

StyleBox focus

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.

Source revision 4f5b14abade2
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.