Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
LinkButton
繼承: BaseButton < Control < CanvasItem < Node < Object
代表連結的按鈕。
說明
代表連結的按鈕。這種按鈕主要用於與按鈕的互動引起本文變化時(如連結到網頁)。
另見 BaseButton,它包含了該節點相關的常用屬性和方法。
屬性
|
||
focus_mode |
|
|
|
||
mouse_default_cursor_shape |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
主題屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
列舉
enum UnderlineMode: 🔗
UnderlineMode UNDERLINE_MODE_ALWAYS = 0
LinkButton 將始終在其文字底部顯示底線。
UnderlineMode UNDERLINE_MODE_ON_HOVER = 1
LinkButton 將在滑鼠游標懸停時,在文字底部顯示底線。
UnderlineMode UNDERLINE_MODE_NEVER = 2
LinkButton 永遠不會在其文字底部顯示底線。
屬性說明
Ellipsis character used for text clipping.
Language code used for line-breaking and text shaping algorithms. If left empty, the current locale is used instead.
StructuredTextParser structured_text_bidi_override = 0 🔗
void set_structured_text_bidi_override(value: StructuredTextParser)
StructuredTextParser get_structured_text_bidi_override()
為結構化文字設定 BiDi 演算法覆蓋。
Array structured_text_bidi_override_options = [] 🔗
void set_structured_text_bidi_override_options(value: Array)
Array get_structured_text_bidi_override_options()
設定 BiDi 覆蓋的附加選項。
該按鈕的文字,將顯示在按鈕的區域內。
TextDirection text_direction = 0 🔗
void set_text_direction(value: TextDirection)
TextDirection get_text_direction()
基礎文字書寫方向。
OverrunBehavior text_overrun_behavior = 0 🔗
void set_text_overrun_behavior(value: OverrunBehavior)
OverrunBehavior get_text_overrun_behavior()
Sets the clipping behavior when the text exceeds the node's bounding rectangle.
UnderlineMode underline = 0 🔗
void set_underline_mode(value: UnderlineMode)
UnderlineMode get_underline_mode()
The underline mode to use for the text.
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.
主題屬性說明
Color font_color = Color(0.875, 0.875, 0.875, 1) 🔗
LinkButton 預設的字形顏色 Color。
Color font_disabled_color = Color(0, 0, 0, 1) 🔗
Color font_focus_color = Color(0.95, 0.95, 0.95, 1) 🔗
當 LinkButton 獲得焦點時使用的文字 Color。只替換按鈕的正常文字顏色。禁用、懸停和按下狀態優先於這個顏色。
Color font_hover_color = Color(0.95, 0.95, 0.95, 1) 🔗
當 LinkButton 被懸停時使用的文字顏色 Color。
Color font_hover_pressed_color = Color(0, 0, 0, 1) 🔗
該 Button 處於懸停並按下狀態時,使用的文字 Color。
Color font_outline_color = Color(0, 0, 0, 1) 🔗
LinkButton 的文字輪廓的色調。
Color font_pressed_color = Color(1, 1, 1, 1) 🔗
當 LinkButton 被按下時使用的文字顏色 Color。
文字輪廓的大小。
注意:如果使用啟用了 FontFile.multichannel_signed_distance_field 的字形,其 FontFile.msdf_pixel_range 必須至少設定為 outline_size 的兩倍,輪廓算繪才能看起來正確。否則,輪廓可能會比預期的更早被切斷。
文字基線和底線之間的垂直空間。
該 LinkButton 文字的字形 Font。
該 LinkButton 文字的字形大小。
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.