Documentation
¶
Overview ¶
Package RichTextLabel provides methods for working with RichTextLabel object instances.
Index ¶
- type Advanced
- type Any
- type HorizontalAlignment
- type ImageUpdateMask
- type InlineAlignment
- type Instance
- func (self Instance) AddImage(image [1]gdclass.Texture2D)
- func (self Instance) AddText(text string)
- func (self Instance) AppendText(bbcode string)
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRichTextLabel() Instance
- func (self Instance) AutowrapMode() gdclass.TextServerAutowrapMode
- func (self Instance) BbcodeEnabled() bool
- func (self Instance) Clear()
- func (self Instance) ContextMenuEnabled() bool
- func (self Instance) CustomEffects() []any
- func (self Instance) Deselect()
- func (self Instance) DeselectOnFocusLossEnabled() bool
- func (self Instance) DragAndDropSelectionEnabled() bool
- func (self Instance) FitContent() bool
- func (self Instance) GetCharacterLine(character int) int
- func (self Instance) GetCharacterParagraph(character int) int
- func (self Instance) GetContentHeight() int
- func (self Instance) GetContentWidth() int
- func (self Instance) GetLineCount() int
- func (self Instance) GetLineOffset(line int) Float.X
- func (self Instance) GetLineRange(line int) Vector2i.XY
- func (self Instance) GetMenu() [1]gdclass.PopupMenu
- func (self Instance) GetParagraphCount() int
- func (self Instance) GetParagraphOffset(paragraph int) Float.X
- func (self Instance) GetParsedText() string
- func (self Instance) GetSelectedText() string
- func (self Instance) GetSelectionFrom() int
- func (self Instance) GetSelectionLineOffset() Float.X
- func (self Instance) GetSelectionTo() int
- func (self Instance) GetTotalCharacterCount() int
- func (self Instance) GetVScrollBar() [1]gdclass.VScrollBar
- func (self Instance) GetVisibleLineCount() int
- func (self Instance) GetVisibleParagraphCount() int
- func (self Instance) HintUnderlined() bool
- func (self Instance) HorizontalAlignment() HorizontalAlignment
- func (self Instance) InstallEffect(effect any)
- func (self Instance) InvalidateParagraph(paragraph int) bool
- func (self Instance) IsFinished() bool
- func (self Instance) IsMenuVisible() bool
- func (self Instance) IsReady() bool
- func (self Instance) JustificationFlags() gdclass.TextServerJustificationFlag
- func (self Instance) Language() string
- func (self Instance) MenuOption(option int)
- func (self Instance) MetaUnderlined() bool
- func (self Instance) Newline()
- func (self Instance) OnFinished(cb func())
- func (self Instance) OnMetaClicked(cb func(meta any))
- func (self Instance) OnMetaHoverEnded(cb func(meta any))
- func (self Instance) OnMetaHoverStarted(cb func(meta any))
- func (self Instance) ParseBbcode(bbcode string)
- func (self Instance) ParseExpressionsForValues(expressions []string) map[string]interface{}
- func (self Instance) Pop()
- func (self Instance) PopAll()
- func (self Instance) PopContext()
- func (self Instance) ProgressBarDelay() int
- func (self Instance) PushBgcolor(bgcolor Color.RGBA)
- func (self Instance) PushBold()
- func (self Instance) PushBoldItalics()
- func (self Instance) PushCell()
- func (self Instance) PushColor(color Color.RGBA)
- func (self Instance) PushContext()
- func (self Instance) PushCustomfx(effect [1]gdclass.RichTextEffect, env map[string]interface{})
- func (self Instance) PushDropcap(s string, font [1]gdclass.Font, size int)
- func (self Instance) PushFgcolor(fgcolor Color.RGBA)
- func (self Instance) PushFont(font [1]gdclass.Font)
- func (self Instance) PushFontSize(font_size int)
- func (self Instance) PushHint(description string)
- func (self Instance) PushIndent(level int)
- func (self Instance) PushItalics()
- func (self Instance) PushLanguage(language string)
- func (self Instance) PushList(level int, atype gdclass.RichTextLabelListType, capitalize bool)
- func (self Instance) PushMeta(data any)
- func (self Instance) PushMono()
- func (self Instance) PushNormal()
- func (self Instance) PushOutlineColor(color Color.RGBA)
- func (self Instance) PushOutlineSize(outline_size int)
- func (self Instance) PushParagraph(alignment HorizontalAlignment)
- func (self Instance) PushStrikethrough()
- func (self Instance) PushTable(columns int)
- func (self Instance) PushUnderline()
- func (self Instance) RemoveParagraph(paragraph int) bool
- func (self Instance) ScrollActive() bool
- func (self Instance) ScrollFollowing() bool
- func (self Instance) ScrollToLine(line int)
- func (self Instance) ScrollToParagraph(paragraph int)
- func (self Instance) ScrollToSelection()
- func (self Instance) SelectAll()
- func (self Instance) SelectionEnabled() bool
- func (self Instance) SetAutowrapMode(value gdclass.TextServerAutowrapMode)
- func (self Instance) SetBbcodeEnabled(value bool)
- func (self Instance) SetCellBorderColor(color Color.RGBA)
- func (self Instance) SetCellPadding(padding Rect2.PositionSize)
- func (self Instance) SetCellRowBackgroundColor(odd_row_bg Color.RGBA, even_row_bg Color.RGBA)
- func (self Instance) SetCellSizeOverride(min_size Vector2.XY, max_size Vector2.XY)
- func (self Instance) SetContextMenuEnabled(value bool)
- func (self Instance) SetCustomEffects(value []any)
- func (self Instance) SetDeselectOnFocusLossEnabled(value bool)
- func (self Instance) SetDragAndDropSelectionEnabled(value bool)
- func (self Instance) SetFitContent(value bool)
- func (self Instance) SetHintUnderlined(value bool)
- func (self Instance) SetHorizontalAlignment(value HorizontalAlignment)
- func (self Instance) SetJustificationFlags(value gdclass.TextServerJustificationFlag)
- func (self Instance) SetLanguage(value string)
- func (self Instance) SetMetaUnderlined(value bool)
- func (self Instance) SetProgressBarDelay(value int)
- func (self Instance) SetScrollActive(value bool)
- func (self Instance) SetScrollFollowing(value bool)
- func (self Instance) SetSelectionEnabled(value bool)
- func (self Instance) SetShortcutKeysEnabled(value bool)
- func (self Instance) SetStructuredTextBidiOverride(value gdclass.TextServerStructuredTextParser)
- func (self Instance) SetStructuredTextBidiOverrideOptions(value []any)
- func (self Instance) SetTabSize(value int)
- func (self Instance) SetTabStops(value []float32)
- func (self Instance) SetTableColumnExpand(column int, expand bool)
- func (self Instance) SetText(value string)
- func (self Instance) SetTextDirection(value gdclass.ControlTextDirection)
- func (self Instance) SetThreaded(value bool)
- func (self Instance) SetVerticalAlignment(value VerticalAlignment)
- func (self Instance) SetVisibleCharacters(value int)
- func (self Instance) SetVisibleCharactersBehavior(value gdclass.TextServerVisibleCharactersBehavior)
- func (self Instance) SetVisibleRatio(value Float.X)
- func (self Instance) ShortcutKeysEnabled() bool
- func (self Instance) StructuredTextBidiOverride() gdclass.TextServerStructuredTextParser
- func (self Instance) StructuredTextBidiOverrideOptions() []any
- func (self Instance) TabSize() int
- func (self Instance) TabStops() []float32
- func (self Instance) Text() string
- func (self Instance) TextDirection() gdclass.ControlTextDirection
- func (self Instance) Threaded() bool
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) UpdateImage(key any, mask gdclass.RichTextLabelImageUpdateMask, image [1]gdclass.Texture2D)
- func (self Instance) VerticalAlignment() VerticalAlignment
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) VisibleCharacters() int
- func (self Instance) VisibleCharactersBehavior() gdclass.TextServerVisibleCharactersBehavior
- func (self Instance) VisibleRatio() Float.X
- type ListType
- type MenuItems
- type MetaUnderline
- type VerticalAlignment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type HorizontalAlignment ¶
type HorizontalAlignment int
const ( /*Horizontal left alignment, usually for text-derived classes.*/ HorizontalAlignmentLeft HorizontalAlignment = 0 /*Horizontal center alignment, usually for text-derived classes.*/ HorizontalAlignmentCenter HorizontalAlignment = 1 /*Horizontal right alignment, usually for text-derived classes.*/ HorizontalAlignmentRight HorizontalAlignment = 2 /*Expand row to fit width, usually for text-derived classes.*/ HorizontalAlignmentFill HorizontalAlignment = 3 )
type ImageUpdateMask ¶
type ImageUpdateMask = gdclass.RichTextLabelImageUpdateMask //gd:RichTextLabel.ImageUpdateMask
const ( /*If this bit is set, [method update_image] changes image texture.*/ UpdateTexture ImageUpdateMask = 1 /*If this bit is set, [method update_image] changes image size.*/ UpdateSize ImageUpdateMask = 2 /*If this bit is set, [method update_image] changes image color.*/ UpdateColor ImageUpdateMask = 4 /*If this bit is set, [method update_image] changes image inline alignment.*/ UpdateAlignment ImageUpdateMask = 8 /*If this bit is set, [method update_image] changes image texture region.*/ UpdateRegion ImageUpdateMask = 16 /*If this bit is set, [method update_image] changes image padding.*/ UpdatePad ImageUpdateMask = 32 /*If this bit is set, [method update_image] changes image tooltip.*/ UpdateTooltip ImageUpdateMask = 64 /*If this bit is set, [method update_image] changes image width from/to percents.*/ UpdateWidthInPercent ImageUpdateMask = 128 )
type InlineAlignment ¶
type InlineAlignment int
const ( /*Aligns the top of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant.*/ InlineAlignmentTopTo InlineAlignment = 0 /*Aligns the center of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant.*/ InlineAlignmentCenterTo InlineAlignment = 1 /*Aligns the baseline (user defined) of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant.*/ InlineAlignmentBaselineTo InlineAlignment = 3 /*Aligns the bottom of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant.*/ InlineAlignmentBottomTo InlineAlignment = 2 /*Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the top of the text.*/ InlineAlignmentToTop InlineAlignment = 0 /*Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the center of the text.*/ InlineAlignmentToCenter InlineAlignment = 4 /*Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the baseline of the text.*/ InlineAlignmentToBaseline InlineAlignment = 8 /*Aligns inline object (e.g. image, table) to the bottom of the text.*/ InlineAlignmentToBottom InlineAlignment = 12 /*Aligns top of the inline object (e.g. image, table) to the top of the text. Equivalent to [code]INLINE_ALIGNMENT_TOP_TO | INLINE_ALIGNMENT_TO_TOP[/code].*/ InlineAlignmentTop InlineAlignment = 0 /*Aligns center of the inline object (e.g. image, table) to the center of the text. Equivalent to [code]INLINE_ALIGNMENT_CENTER_TO | INLINE_ALIGNMENT_TO_CENTER[/code].*/ InlineAlignmentCenter InlineAlignment = 5 /*Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equivalent to [code]INLINE_ALIGNMENT_BOTTOM_TO | INLINE_ALIGNMENT_TO_BOTTOM[/code].*/ InlineAlignmentBottom InlineAlignment = 14 /*A bit mask for [code]INLINE_ALIGNMENT_*_TO[/code] alignment constants.*/ InlineAlignmentImageMask InlineAlignment = 3 /*A bit mask for [code]INLINE_ALIGNMENT_TO_*[/code] alignment constants.*/ InlineAlignmentTextMask InlineAlignment = 12 )
type Instance ¶
type Instance [1]gdclass.RichTextLabel
A control for displaying text that can contain custom fonts, images, and basic formatting. [RichTextLabel] manages these as an internal tag stack. It also adapts itself to given width/heights. [b]Note:[/b] [method newline], [method push_paragraph], [code]"\n"[/code], [code]"\r\n"[/code], [code]p[/code] tag, and alignment tags start a new paragraph. Each paragraph is processed independently, in its own BiDi context. If you want to force line wrapping within paragraph, any other line breaking character can be used, for example, Form Feed (U+000C), Next Line (U+0085), Line Separator (U+2028). [b]Note:[/b] Assignments to [member text] clear the tag stack and reconstruct it from the property's contents. Any edits made to [member text] will erase previous edits made from other manual sources such as [method append_text] and the [code]push_*[/code] / [method pop] methods. [b]Note:[/b] RichTextLabel doesn't support entangled BBCode tags. For example, instead of using [code skip-lint][b]bold[i]bold italic[/b]italic[/i][/code], use [code skip-lint][b]bold[i]bold italic[/i][/b][i]italic[/i][/code]. [b]Note:[/b] [code]push_pop_*[/code] functions won't affect BBCode. [b]Note:[/b] Unlike [Label], [RichTextLabel] doesn't have a [i]property[/i] to horizontally align text to the center. Instead, enable [member bbcode_enabled] and surround the text in a [code skip-lint][center][/code] tag as follows: [code skip-lint][center]Example[/center][/code]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the [member fit_content] property.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddImage ¶
Adds an image's opening and closing tags to the tag stack, optionally providing a [param width] and [param height] to resize the image, a [param color] to tint the image and a [param region] to only use parts of the image. If [param width] or [param height] is set to 0, the image size will be adjusted in order to keep the original aspect ratio. If [param width] and [param height] are not set, but [param region] is, the region's rect will be used. [param key] is an optional identifier, that can be used to modify the image via [method update_image]. If [param pad] is set, and the image is smaller than the size specified by [param width] and [param height], the image padding is added to match the size instead of upscaling. If [param size_in_percent] is set, [param width] and [param height] values are percentages of the control width instead of pixels.
func (Instance) AppendText ¶
Parses [param bbcode] and adds tags to the tag stack as needed. [b]Note:[/b] Using this method, you can't close a tag that was opened in a previous [method append_text] call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the [member text] instead of using [method append_text].
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) AsRichTextLabel ¶
func (Instance) AutowrapMode ¶
func (self Instance) AutowrapMode() gdclass.TextServerAutowrapMode
func (Instance) BbcodeEnabled ¶
func (Instance) Clear ¶
func (self Instance) Clear()
Clears the tag stack, causing the label to display nothing. [b]Note:[/b] This method does not affect [member text], and its contents will show again if the label is redrawn. However, setting [member text] to an empty [String] also clears the stack.
func (Instance) ContextMenuEnabled ¶
func (Instance) CustomEffects ¶
func (Instance) DeselectOnFocusLossEnabled ¶
func (Instance) DragAndDropSelectionEnabled ¶
func (Instance) FitContent ¶
func (Instance) GetCharacterLine ¶
Returns the line number of the character position provided. Line and character numbers are both zero-indexed. [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
func (Instance) GetCharacterParagraph ¶
Returns the paragraph number of the character position provided. Paragraph and character numbers are both zero-indexed. [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
func (Instance) GetContentHeight ¶
Returns the height of the content. [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
func (Instance) GetContentWidth ¶
Returns the width of the content. [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
func (Instance) GetLineCount ¶
Returns the total number of lines in the text. Wrapped text is counted as multiple lines. [b]Note:[/b] If [member visible_characters_behavior] is set to [constant TextServer.VC_CHARS_BEFORE_SHAPING] only visible wrapped lines are counted. [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
func (Instance) GetLineOffset ¶
Returns the vertical offset of the line found at the provided index. [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
func (Instance) GetLineRange ¶
Returns the indexes of the first and last visible characters for the given [param line], as a [Vector2i]. [b]Note:[/b] If [member visible_characters_behavior] is set to [constant TextServer.VC_CHARS_BEFORE_SHAPING] only visible wrapped lines are counted. [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
func (Instance) GetMenu ¶
Returns the [PopupMenu] of this [RichTextLabel]. By default, this menu is displayed when right-clicking on the [RichTextLabel]. You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see [enum MenuItems]). For example: [codeblocks] [gdscript] func _ready():
var menu = get_menu() # Remove "Select All" item. menu.remove_item(MENU_SELECT_ALL) # Add custom items. menu.add_separator() menu.add_item("Duplicate Text", MENU_MAX + 1) # Connect callback. menu.id_pressed.connect(_on_item_pressed)
func _on_item_pressed(id):
if id == MENU_MAX + 1: add_text("\n" + get_parsed_text())
[/gdscript] [csharp] public override void _Ready()
{ var menu = GetMenu(); // Remove "Select All" item. menu.RemoveItem(RichTextLabel.MenuItems.SelectAll); // Add custom items. menu.AddSeparator(); menu.AddItem("Duplicate Text", RichTextLabel.MenuItems.Max + 1); // Add event handler. menu.IdPressed += OnItemPressed; }
public void OnItemPressed(int id)
{ if (id == TextEdit.MenuItems.Max + 1) { AddText("\n" + GetParsedText()); } }
[/csharp] [/codeblocks] [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
func (Instance) GetParagraphCount ¶
Returns the total number of paragraphs (newlines or [code]p[/code] tags in the tag stack's text tags). Considers wrapped text as one paragraph.
func (Instance) GetParagraphOffset ¶
Returns the vertical offset of the paragraph found at the provided index. [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
func (Instance) GetParsedText ¶
Returns the text without BBCode mark-up.
func (Instance) GetSelectedText ¶
Returns the current selection text. Does not include BBCodes.
func (Instance) GetSelectionFrom ¶
Returns the current selection first character index if a selection is active, [code]-1[/code] otherwise. Does not include BBCodes.
func (Instance) GetSelectionLineOffset ¶
Returns the current selection vertical line offset if a selection is active, [code]-1.0[/code] otherwise.
func (Instance) GetSelectionTo ¶
Returns the current selection last character index if a selection is active, [code]-1[/code] otherwise. Does not include BBCodes.
func (Instance) GetTotalCharacterCount ¶
Returns the total number of characters from text tags. Does not include BBCodes.
func (Instance) GetVScrollBar ¶
func (self Instance) GetVScrollBar() [1]gdclass.VScrollBar
Returns the vertical scrollbar. [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
func (Instance) GetVisibleLineCount ¶
Returns the number of visible lines. [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
func (Instance) GetVisibleParagraphCount ¶
Returns the number of visible paragraphs. A paragraph is considered visible if at least one of its lines is visible. [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
func (Instance) HintUnderlined ¶
func (Instance) HorizontalAlignment ¶
func (self Instance) HorizontalAlignment() HorizontalAlignment
func (Instance) InstallEffect ¶
Installs a custom effect. This can also be done in the Inspector through the [member custom_effects] property. [param effect] should be a valid [RichTextEffect]. [b]Example:[/b] With the following script extending from [RichTextEffect]: [codeblock] # effect.gd class_name MyCustomEffect extends RichTextEffect
var bbcode = "my_custom_effect"
# ... [/codeblock] The above effect can be installed in [RichTextLabel] from a script: [codeblock] # rich_text_label.gd extends RichTextLabel
func _ready():
install_effect(MyCustomEffect.new()) # Alternatively, if not using `class_name` in the script that extends RichTextEffect: install_effect(preload("res://effect.gd").new())
[/codeblock]
func (Instance) InvalidateParagraph ¶
Invalidates [param paragraph] and all subsequent paragraphs cache.
func (Instance) IsFinished ¶
If [member threaded] is enabled, returns [code]true[/code] if the background thread has finished text processing, otherwise always return [code]true[/code].
func (Instance) IsMenuVisible ¶
Returns whether the menu is visible. Use this instead of [code]get_menu().visible[/code] to improve performance (so the creation of the menu is avoided).
func (Instance) IsReady ¶
If [member threaded] is enabled, returns [code]true[/code] if the background thread has finished text processing, otherwise always return [code]true[/code].
func (Instance) JustificationFlags ¶
func (self Instance) JustificationFlags() gdclass.TextServerJustificationFlag
func (Instance) MenuOption ¶
Executes a given action as defined in the [enum MenuItems] enum.
func (Instance) MetaUnderlined ¶
func (Instance) OnFinished ¶
func (self Instance) OnFinished(cb func())
func (Instance) OnMetaClicked ¶
func (Instance) OnMetaHoverEnded ¶
func (Instance) OnMetaHoverStarted ¶
func (Instance) ParseBbcode ¶
The assignment version of [method append_text]. Clears the tag stack and inserts the new content.
func (Instance) ParseExpressionsForValues ¶
Parses BBCode parameter [param expressions] into a dictionary.
func (Instance) Pop ¶
func (self Instance) Pop()
Terminates the current tag. Use after [code]push_*[/code] methods to close BBCodes manually. Does not need to follow [code]add_*[/code] methods.
func (Instance) PopAll ¶
func (self Instance) PopAll()
Terminates all tags opened by [code]push_*[/code] methods.
func (Instance) PopContext ¶
func (self Instance) PopContext()
Terminates tags opened after the last [method push_context] call (including context marker), or all tags if there's no context marker on the stack.
func (Instance) ProgressBarDelay ¶
func (Instance) PushBgcolor ¶
Adds a [code skip-lint][bgcolor][/code] tag to the tag stack.
func (Instance) PushBold ¶
func (self Instance) PushBold()
Adds a [code skip-lint][font][/code] tag with a bold font to the tag stack. This is the same as adding a [code skip-lint][b][/code] tag if not currently in a [code skip-lint][i][/code] tag.
func (Instance) PushBoldItalics ¶
func (self Instance) PushBoldItalics()
Adds a [code skip-lint][font][/code] tag with a bold italics font to the tag stack.
func (Instance) PushCell ¶
func (self Instance) PushCell()
Adds a [code skip-lint][cell][/code] tag to the tag stack. Must be inside a [code skip-lint][table][/code] tag. See [method push_table] for details. Use [method set_table_column_expand] to set column expansion ratio, [method set_cell_border_color] to set cell border, [method set_cell_row_background_color] to set cell background, [method set_cell_size_override] to override cell size, and [method set_cell_padding] to set padding.
func (Instance) PushContext ¶
func (self Instance) PushContext()
Adds a context marker to the tag stack. See [method pop_context].
func (Instance) PushCustomfx ¶
func (self Instance) PushCustomfx(effect [1]gdclass.RichTextEffect, env map[string]interface{})
Adds a custom effect tag to the tag stack. The effect does not need to be in [member custom_effects]. The environment is directly passed to the effect.
func (Instance) PushDropcap ¶
Adds a [code skip-lint][dropcap][/code] tag to the tag stack. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text.
func (Instance) PushFgcolor ¶
Adds a [code skip-lint][fgcolor][/code] tag to the tag stack.
func (Instance) PushFont ¶
Adds a [code skip-lint][font][/code] tag to the tag stack. Overrides default fonts for its duration. Passing [code]0[/code] to [param font_size] will use the existing default font size.
func (Instance) PushFontSize ¶
Adds a [code skip-lint][font_size][/code] tag to the tag stack. Overrides default font size for its duration.
func (Instance) PushHint ¶
Adds a [code skip-lint][hint][/code] tag to the tag stack. Same as BBCode [code skip-lint][hint=something]{text}[/hint][/code].
func (Instance) PushIndent ¶
Adds an [code skip-lint][indent][/code] tag to the tag stack. Multiplies [param level] by current [member tab_size] to determine new margin length.
func (Instance) PushItalics ¶
func (self Instance) PushItalics()
Adds a [code skip-lint][font][/code] tag with an italics font to the tag stack. This is the same as adding an [code skip-lint][i][/code] tag if not currently in a [code skip-lint][b][/code] tag.
func (Instance) PushLanguage ¶
Adds language code used for text shaping algorithm and Open-Type font features.
func (Instance) PushList ¶
func (self Instance) PushList(level int, atype gdclass.RichTextLabelListType, capitalize bool)
Adds [code skip-lint][ol][/code] or [code skip-lint][ul][/code] tag to the tag stack. Multiplies [param level] by current [member tab_size] to determine new margin length.
func (Instance) PushMeta ¶
Adds a meta tag to the tag stack. Similar to the BBCode [code skip-lint][url=something]{text}[/url][/code], but supports non-[String] metadata types. If [member meta_underlined] is [code]true[/code], meta tags display an underline. This behavior can be customized with [param underline_mode]. [b]Note:[/b] Meta tags do nothing by default when clicked. To assign behavior when clicked, connect [signal meta_clicked] to a function that is called when the meta tag is clicked.
func (Instance) PushMono ¶
func (self Instance) PushMono()
Adds a [code skip-lint][font][/code] tag with a monospace font to the tag stack.
func (Instance) PushNormal ¶
func (self Instance) PushNormal()
Adds a [code skip-lint][font][/code] tag with a normal font to the tag stack.
func (Instance) PushOutlineColor ¶
Adds a [code skip-lint][outline_color][/code] tag to the tag stack. Adds text outline for its duration.
func (Instance) PushOutlineSize ¶
Adds a [code skip-lint][outline_size][/code] tag to the tag stack. Overrides default text outline size for its duration.
func (Instance) PushParagraph ¶
func (self Instance) PushParagraph(alignment HorizontalAlignment)
Adds a [code skip-lint][p][/code] tag to the tag stack.
func (Instance) PushStrikethrough ¶
func (self Instance) PushStrikethrough()
Adds a [code skip-lint][s][/code] tag to the tag stack.
func (Instance) PushTable ¶
Adds a [code skip-lint][table=columns,inline_align][/code] tag to the tag stack. Use [method set_table_column_expand] to set column expansion ratio. Use [method push_cell] to add cells.
func (Instance) PushUnderline ¶
func (self Instance) PushUnderline()
Adds a [code skip-lint][u][/code] tag to the tag stack.
func (Instance) RemoveParagraph ¶
Removes a paragraph of content from the label. Returns [code]true[/code] if the paragraph exists. The [param paragraph] argument is the index of the paragraph to remove, it can take values in the interval [code][0, get_paragraph_count() - 1][/code]. If [param no_invalidate] is set to [code]true[/code], cache for the subsequent paragraphs is not invalidated. Use it for faster updates if deleted paragraph is fully self-contained (have no unclosed tags), or this call is part of the complex edit operation and [method invalidate_paragraph] will be called at the end of operation.
func (Instance) ScrollActive ¶
func (Instance) ScrollFollowing ¶
func (Instance) ScrollToLine ¶
Scrolls the window's top line to match [param line].
func (Instance) ScrollToParagraph ¶
Scrolls the window's top line to match first line of the [param paragraph].
func (Instance) ScrollToSelection ¶
func (self Instance) ScrollToSelection()
Scrolls to the beginning of the current selection.
func (Instance) SelectAll ¶
func (self Instance) SelectAll()
Select all the text. If [member selection_enabled] is [code]false[/code], no selection will occur.
func (Instance) SelectionEnabled ¶
func (Instance) SetAutowrapMode ¶
func (self Instance) SetAutowrapMode(value gdclass.TextServerAutowrapMode)
func (Instance) SetBbcodeEnabled ¶
func (Instance) SetCellBorderColor ¶
Sets color of a table cell border.
func (Instance) SetCellPadding ¶
func (self Instance) SetCellPadding(padding Rect2.PositionSize)
Sets inner padding of a table cell.
func (Instance) SetCellRowBackgroundColor ¶
Sets color of a table cell. Separate colors for alternating rows can be specified.
func (Instance) SetCellSizeOverride ¶
Sets minimum and maximum size overrides for a table cell.
func (Instance) SetContextMenuEnabled ¶
func (Instance) SetCustomEffects ¶
func (Instance) SetDeselectOnFocusLossEnabled ¶
func (Instance) SetDragAndDropSelectionEnabled ¶
func (Instance) SetFitContent ¶
func (Instance) SetHintUnderlined ¶
func (Instance) SetHorizontalAlignment ¶
func (self Instance) SetHorizontalAlignment(value HorizontalAlignment)
func (Instance) SetJustificationFlags ¶
func (self Instance) SetJustificationFlags(value gdclass.TextServerJustificationFlag)
func (Instance) SetLanguage ¶
func (Instance) SetMetaUnderlined ¶
func (Instance) SetProgressBarDelay ¶
func (Instance) SetScrollActive ¶
func (Instance) SetScrollFollowing ¶
func (Instance) SetSelectionEnabled ¶
func (Instance) SetShortcutKeysEnabled ¶
func (Instance) SetStructuredTextBidiOverride ¶
func (self Instance) SetStructuredTextBidiOverride(value gdclass.TextServerStructuredTextParser)
func (Instance) SetStructuredTextBidiOverrideOptions ¶
func (Instance) SetTabSize ¶
func (Instance) SetTabStops ¶
func (Instance) SetTableColumnExpand ¶
Edits the selected column's expansion options. If [param expand] is [code]true[/code], the column expands in proportion to its expansion ratio versus the other columns' ratios. For example, 2 columns with ratios 3 and 4 plus 70 pixels in available width would expand 30 and 40 pixels, respectively. If [param expand] is [code]false[/code], the column will not contribute to the total ratio.
func (Instance) SetTextDirection ¶
func (self Instance) SetTextDirection(value gdclass.ControlTextDirection)
func (Instance) SetThreaded ¶
func (Instance) SetVerticalAlignment ¶
func (self Instance) SetVerticalAlignment(value VerticalAlignment)
func (Instance) SetVisibleCharacters ¶
func (Instance) SetVisibleCharactersBehavior ¶
func (self Instance) SetVisibleCharactersBehavior(value gdclass.TextServerVisibleCharactersBehavior)
func (Instance) SetVisibleRatio ¶
func (Instance) ShortcutKeysEnabled ¶
func (Instance) StructuredTextBidiOverride ¶
func (self Instance) StructuredTextBidiOverride() gdclass.TextServerStructuredTextParser
func (Instance) StructuredTextBidiOverrideOptions ¶
func (Instance) TextDirection ¶
func (self Instance) TextDirection() gdclass.ControlTextDirection
func (*Instance) UnsafePointer ¶
func (Instance) UpdateImage ¶
func (self Instance) UpdateImage(key any, mask gdclass.RichTextLabelImageUpdateMask, image [1]gdclass.Texture2D)
Updates the existing images with the key [param key]. Only properties specified by [param mask] bits are updated. See [method add_image].
func (Instance) VerticalAlignment ¶
func (self Instance) VerticalAlignment() VerticalAlignment
func (Instance) VisibleCharacters ¶
func (Instance) VisibleCharactersBehavior ¶
func (self Instance) VisibleCharactersBehavior() gdclass.TextServerVisibleCharactersBehavior
func (Instance) VisibleRatio ¶
type ListType ¶
type ListType = gdclass.RichTextLabelListType //gd:RichTextLabel.ListType
type MenuItems ¶
type MenuItems = gdclass.RichTextLabelMenuItems //gd:RichTextLabel.MenuItems
type MetaUnderline ¶
type MetaUnderline = gdclass.RichTextLabelMetaUnderline //gd:RichTextLabel.MetaUnderline
const ( /*Meta tag does not display an underline, even if [member meta_underlined] is [code]true[/code].*/ MetaUnderlineNever MetaUnderline = 0 /*If [member meta_underlined] is [code]true[/code], meta tag always display an underline.*/ MetaUnderlineAlways MetaUnderline = 1 /*If [member meta_underlined] is [code]true[/code], meta tag display an underline when the mouse cursor is over it.*/ MetaUnderlineOnHover MetaUnderline = 2 )
type VerticalAlignment ¶
type VerticalAlignment int
const ( /*Vertical top alignment, usually for text-derived classes.*/ VerticalAlignmentTop VerticalAlignment = 0 /*Vertical center alignment, usually for text-derived classes.*/ VerticalAlignmentCenter VerticalAlignment = 1 /*Vertical bottom alignment, usually for text-derived classes.*/ VerticalAlignmentBottom VerticalAlignment = 2 /*Expand rows to fit height, usually for text-derived classes.*/ VerticalAlignmentFill VerticalAlignment = 3 )