LinkButton

Inherits: BaseButton < Control < CanvasItem < Node < Object

Simple button used to represent a link to some resource.

Description

This kind of button is primarily used when the interaction with the button causes a context change (like linking to a web page).

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

Properties

FocusMode

focus_mode

0 (overrides Control)

CursorShape

mouse_default_cursor_shape

2 (overrides Control)

String

text

""

UnderlineMode

underline

0

String

uri

""

Theme Properties

Color

font_color

Color( 0.88, 0.88, 0.88, 1 )

Color

font_color_focus

Color( 0.94, 0.94, 0.94, 1 )

Color

font_color_hover

Color( 0.94, 0.94, 0.94, 1 )

Color

font_color_pressed

Color( 1, 1, 1, 1 )

int

underline_spacing

2

Font

font

StyleBox

focus


Enumerations

enum UnderlineMode:

UnderlineMode UNDERLINE_MODE_ALWAYS = 0

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

UnderlineMode UNDERLINE_MODE_ON_HOVER = 1

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

UnderlineMode UNDERLINE_MODE_NEVER = 2

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


Property Descriptions

String text = ""

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


UnderlineMode underline = 0

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


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.

Examples:

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

Color font_color = Color( 0.88, 0.88, 0.88, 1 )

Default text Color of the LinkButton.


Color font_color_focus = Color( 0.94, 0.94, 0.94, 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_color_hover = Color( 0.94, 0.94, 0.94, 1 )

Text Color used when the LinkButton is being hovered.


Color font_color_pressed = Color( 1, 1, 1, 1 )

Text Color used when the LinkButton is being pressed.


int underline_spacing = 2

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


Font font

Font of the LinkButton's text.


StyleBox focus

StyleBox used when the LinkButton is focused. It is displayed over the current StyleBox, so using StyleBoxEmpty will just disable the focus visual effect.