RichTextLabel

package
v0.0.0-...-c858641 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 36 Imported by: 0

Documentation

Overview

A control for displaying text that can contain custom fonts, images, and basic formatting. graphics.gd/classdb/RichTextLabel manages these as an internal tag stack. It also adapts itself to given width/heights.

Note: Instance.Newline, Instance.PushParagraph, "\n", "\r\n", p 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).

Note: Assignments to Instance.Text clear the tag stack and reconstruct it from the property's contents. Any edits made to Instance.Text will erase previous edits made from other manual sources such as Instance.AppendText and the push_* / Instance.Pop methods.

Note: RichTextLabel doesn't support entangled BBCode tags. For example, instead of using [b]bold[i]bold italic[/b]italic[/i], use [b]bold[i]bold italic[/i][/b][i]italic[/i].

Note: push_pop_* functions won't affect BBCode.

Note: Unlike graphics.gd/classdb/Label, graphics.gd/classdb/RichTextLabel doesn't have a property to horizontally align text to the center. Instead, enable Instance.BbcodeEnabled and surround the text in a [center] tag as follows: [center]Example[/center]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the Instance.FitContent property.

Index

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 Any

type Any interface {
	gd.IsClass
	AsRichTextLabel() Instance
}

type Expanded

type Expanded [1]gdclass.RichTextLabel

func (Expanded) AddImage

func (self Expanded) AddImage(image Texture2D.Instance, width int, height int, color Color.RGBA, inline_align GUI.InlineAlignment, region Rect2.PositionSize, key any, pad bool, tooltip string, size_in_percent bool)

Adds an image's opening and closing tags to the tag stack, optionally providing a 'width' and 'height' to resize the image, a 'color' to tint the image and a 'region' to only use parts of the image.

If 'width' or 'height' is set to 0, the image size will be adjusted in order to keep the original aspect ratio.

If 'width' and 'height' are not set, but 'region' is, the region's rect will be used.

'key' is an optional identifier, that can be used to modify the image via Instance.UpdateImage.

If 'pad' is set, and the image is smaller than the size specified by 'width' and 'height', the image padding is added to match the size instead of upscaling.

If 'size_in_percent' is set, 'width' and 'height' values are percentages of the control width instead of pixels.

func (Expanded) PushDropcap

func (self Expanded) PushDropcap(s string, font Font.Instance, size int, dropcap_margins Rect2.PositionSize, color Color.RGBA, outline_size int, outline_color Color.RGBA)

Adds a [dropcap] 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 (Expanded) PushFont

func (self Expanded) PushFont(font Font.Instance, font_size int)

Adds a [font] tag to the tag stack. Overrides default fonts for its duration.

Passing 0 to 'font_size' will use the existing default font size.

func (Expanded) PushList

func (self Expanded) PushList(level int, atype ListType, capitalize bool, bullet string)

Adds [ol] or [ul] tag to the tag stack. Multiplies 'level' by current Instance.TabSize to determine new margin length.

func (Expanded) PushMeta

func (self Expanded) PushMeta(data any, underline_mode MetaUnderline, tooltip string)

Adds a meta tag to the tag stack. Similar to the BBCode [url=something]{text}[/url], but supports non-string metadata types.

If Instance.MetaUnderlined is true, meta tags display an underline. This behavior can be customized with 'underline_mode'.

Note: Meta tags do nothing by default when clicked. To assign behavior when clicked, connect Instance.OnMetaClicked to a function that is called when the meta tag is clicked.

func (Expanded) PushParagraph

func (self Expanded) PushParagraph(alignment GUI.HorizontalAlignment, base_direction Control.TextDirection, language string, st_parser TextServer.StructuredTextParser, justification_flags TextServer.JustificationFlag, tab_stops []float32)

Adds a [p] tag to the tag stack.

func (Expanded) PushTable

func (self Expanded) PushTable(columns int, inline_align GUI.InlineAlignment, align_to_row int)

Adds a [table=columns,inline_align] tag to the tag stack. Use Instance.SetTableColumnExpand to set column expansion ratio. Use Instance.PushCell to add cells.

func (Expanded) RemoveParagraph

func (self Expanded) RemoveParagraph(paragraph int, no_invalidate bool) bool

Removes a paragraph of content from the label. Returns true if the paragraph exists.

The 'paragraph' argument is the index of the paragraph to remove, it can take values in the interval [0, get_paragraph_count() - 1].

If 'no_invalidate' is set to true, 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 Instance.InvalidateParagraph will be called at the end of operation.

func (Expanded) SetTableColumnExpand

func (self Expanded) SetTableColumnExpand(column int, expand bool, ratio int, shrink bool)

Edits the selected column's expansion options. If 'expand' is true, 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 'expand' is false, the column will not contribute to the total ratio.

func (Expanded) UpdateImage

func (self Expanded) UpdateImage(key any, mask ImageUpdateMask, image Texture2D.Instance, width int, height int, color Color.RGBA, inline_align GUI.InlineAlignment, region Rect2.PositionSize, pad bool, tooltip string, size_in_percent bool)

Updates the existing images with the key 'key'. Only properties specified by 'mask' bits are updated. See Instance.AddImage.

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsCanvasItem

func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance

func (*Extension[T]) AsControl

func (self *Extension[T]) AsControl() Control.Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRichTextLabel

func (self *Extension[T]) AsRichTextLabel() Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type ImageUpdateMask

type ImageUpdateMask int //gd:RichTextLabel.ImageUpdateMask
const (
	// If this bit is set, [Instance.UpdateImage] changes image texture.
	UpdateTexture ImageUpdateMask = 1
	// If this bit is set, [Instance.UpdateImage] changes image size.
	UpdateSize ImageUpdateMask = 2
	// If this bit is set, [Instance.UpdateImage] changes image color.
	UpdateColor ImageUpdateMask = 4
	// If this bit is set, [Instance.UpdateImage] changes image inline alignment.
	UpdateAlignment ImageUpdateMask = 8
	// If this bit is set, [Instance.UpdateImage] changes image texture region.
	UpdateRegion ImageUpdateMask = 16
	// If this bit is set, [Instance.UpdateImage] changes image padding.
	UpdatePad ImageUpdateMask = 32
	// If this bit is set, [Instance.UpdateImage] changes image tooltip.
	UpdateTooltip ImageUpdateMask = 64
	// If this bit is set, [Instance.UpdateImage] changes image width from/to percents.
	UpdateWidthInPercent ImageUpdateMask = 128
)

type Instance

type Instance [1]gdclass.RichTextLabel

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AddImage

func (self Instance) AddImage(image Texture2D.Instance)

Adds an image's opening and closing tags to the tag stack, optionally providing a 'width' and 'height' to resize the image, a 'color' to tint the image and a 'region' to only use parts of the image.

If 'width' or 'height' is set to 0, the image size will be adjusted in order to keep the original aspect ratio.

If 'width' and 'height' are not set, but 'region' is, the region's rect will be used.

'key' is an optional identifier, that can be used to modify the image via Instance.UpdateImage.

If 'pad' is set, and the image is smaller than the size specified by 'width' and 'height', the image padding is added to match the size instead of upscaling.

If 'size_in_percent' is set, 'width' and 'height' values are percentages of the control width instead of pixels.

func (Instance) AddText

func (self Instance) AddText(text string)

Adds raw non-BBCode-parsed text to the tag stack.

func (Instance) AppendText

func (self Instance) AppendText(bbcode string)

Parses 'bbcode' and adds tags to the tag stack as needed.

Note: Using this method, you can't close a tag that was opened in a previous Instance.AppendText 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 Instance.Text instead of using Instance.AppendText.

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRichTextLabel

func (self Instance) AsRichTextLabel() Instance

func (Instance) AutowrapMode

func (self Instance) AutowrapMode() TextServer.AutowrapMode

func (Instance) BbcodeEnabled

func (self Instance) BbcodeEnabled() bool

func (Instance) Clear

func (self Instance) Clear()

Clears the tag stack, causing the label to display nothing.

Note: This method does not affect Instance.Text, and its contents will show again if the label is redrawn. However, setting Instance.Text to an empty string also clears the stack.

func (Instance) ContextMenuEnabled

func (self Instance) ContextMenuEnabled() bool

func (Instance) CustomEffects

func (self Instance) CustomEffects() []any

func (Instance) Deselect

func (self Instance) Deselect()

Clears the current selection.

func (Instance) DeselectOnFocusLossEnabled

func (self Instance) DeselectOnFocusLossEnabled() bool

func (Instance) DragAndDropSelectionEnabled

func (self Instance) DragAndDropSelectionEnabled() bool

func (Instance) FitContent

func (self Instance) FitContent() bool

func (Instance) GetCharacterLine

func (self Instance) GetCharacterLine(character int) int

Returns the line number of the character position provided. Line and character numbers are both zero-indexed.

Note: If Instance.Threaded is enabled, this method returns a value for the loaded part of the document. Use Instance.IsFinished or Instance.OnFinished to determine whether document is fully loaded.

func (Instance) GetCharacterParagraph

func (self Instance) GetCharacterParagraph(character int) int

Returns the paragraph number of the character position provided. Paragraph and character numbers are both zero-indexed.

Note: If Instance.Threaded is enabled, this method returns a value for the loaded part of the document. Use Instance.IsFinished or Instance.OnFinished to determine whether document is fully loaded.

func (Instance) GetContentHeight

func (self Instance) GetContentHeight() int

Returns the height of the content.

Note: If Instance.Threaded is enabled, this method returns a value for the loaded part of the document. Use Instance.IsFinished or Instance.OnFinished to determine whether document is fully loaded.

func (Instance) GetContentWidth

func (self Instance) GetContentWidth() int

Returns the width of the content.

Note: If Instance.Threaded is enabled, this method returns a value for the loaded part of the document. Use Instance.IsFinished or Instance.OnFinished to determine whether document is fully loaded.

func (Instance) GetLineCount

func (self Instance) GetLineCount() int

Returns the total number of lines in the text. Wrapped text is counted as multiple lines.

Note: If Instance.VisibleCharactersBehavior is set to [Textserver.VcCharsBeforeShaping] only visible wrapped lines are counted.

Note: If Instance.Threaded is enabled, this method returns a value for the loaded part of the document. Use Instance.IsFinished or Instance.OnFinished to determine whether document is fully loaded.

func (Instance) GetLineOffset

func (self Instance) GetLineOffset(line int) Float.X

Returns the vertical offset of the line found at the provided index.

Note: If Instance.Threaded is enabled, this method returns a value for the loaded part of the document. Use Instance.IsFinished or Instance.OnFinished to determine whether document is fully loaded.

func (Instance) GetLineRange

func (self Instance) GetLineRange(line int) Vector2i.XY

Returns the indexes of the first and last visible characters for the given 'line', as a [Vector2i.XY].

Note: If Instance.VisibleCharactersBehavior is set to [Textserver.VcCharsBeforeShaping] only visible wrapped lines are counted.

Note: If Instance.Threaded is enabled, this method returns a value for the loaded part of the document. Use Instance.IsFinished or Instance.OnFinished to determine whether document is fully loaded.

func (Instance) GetMenu

func (self Instance) GetMenu() PopupMenu.Instance

Returns the graphics.gd/classdb/PopupMenu of this graphics.gd/classdb/RichTextLabel. By default, this menu is displayed when right-clicking on the graphics.gd/classdb/RichTextLabel.

You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see MenuItems). For example:

Warning: 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 graphics.gd/classdb/Window.Instance.Visible property.

func (Instance) GetParagraphCount

func (self Instance) GetParagraphCount() int

Returns the total number of paragraphs (newlines or p tags in the tag stack's text tags). Considers wrapped text as one paragraph.

func (Instance) GetParagraphOffset

func (self Instance) GetParagraphOffset(paragraph int) Float.X

Returns the vertical offset of the paragraph found at the provided index.

Note: If Instance.Threaded is enabled, this method returns a value for the loaded part of the document. Use Instance.IsFinished or Instance.OnFinished to determine whether document is fully loaded.

func (Instance) GetParsedText

func (self Instance) GetParsedText() string

Returns the text without BBCode mark-up.

func (Instance) GetSelectedText

func (self Instance) GetSelectedText() string

Returns the current selection text. Does not include BBCodes.

func (Instance) GetSelectionFrom

func (self Instance) GetSelectionFrom() int

Returns the current selection first character index if a selection is active, -1 otherwise. Does not include BBCodes.

func (Instance) GetSelectionLineOffset

func (self Instance) GetSelectionLineOffset() Float.X

Returns the current selection vertical line offset if a selection is active, -1.0 otherwise.

func (Instance) GetSelectionTo

func (self Instance) GetSelectionTo() int

Returns the current selection last character index if a selection is active, -1 otherwise. Does not include BBCodes.

func (Instance) GetTotalCharacterCount

func (self Instance) GetTotalCharacterCount() int

Returns the total number of characters from text tags. Does not include BBCodes.

func (Instance) GetVScrollBar

func (self Instance) GetVScrollBar() VScrollBar.Instance

Returns the vertical scrollbar.

Warning: 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 graphics.gd/classdb/CanvasItem.Instance.Visible property.

func (Instance) GetVisibleLineCount

func (self Instance) GetVisibleLineCount() int

Returns the number of visible lines.

Note: If Instance.Threaded is enabled, this method returns a value for the loaded part of the document. Use Instance.IsFinished or Instance.OnFinished to determine whether document is fully loaded.

func (Instance) GetVisibleParagraphCount

func (self Instance) GetVisibleParagraphCount() int

Returns the number of visible paragraphs. A paragraph is considered visible if at least one of its lines is visible.

Note: If Instance.Threaded is enabled, this method returns a value for the loaded part of the document. Use Instance.IsFinished or Instance.OnFinished to determine whether document is fully loaded.

func (Instance) HintUnderlined

func (self Instance) HintUnderlined() bool

func (Instance) HorizontalAlignment

func (self Instance) HorizontalAlignment() GUI.HorizontalAlignment

func (Instance) ID

func (self Instance) ID() ID

func (Instance) InstallEffect

func (self Instance) InstallEffect(effect any)

Installs a custom effect. This can also be done in the Inspector through the Instance.CustomEffects property. 'effect' should be a valid graphics.gd/classdb/RichTextEffect.

Example: With the following script extending from graphics.gd/classdb/RichTextEffect:

The above effect can be installed in graphics.gd/classdb/RichTextLabel from a script:

func (Instance) InvalidateParagraph

func (self Instance) InvalidateParagraph(paragraph int) bool

Invalidates 'paragraph' and all subsequent paragraphs cache.

func (Instance) IsFinished

func (self Instance) IsFinished() bool

If Instance.Threaded is enabled, returns true if the background thread has finished text processing, otherwise always return true.

func (Instance) IsMenuVisible

func (self Instance) IsMenuVisible() bool

Returns whether the menu is visible. Use this instead of get_menu().visible to improve performance (so the creation of the menu is avoided).

func (Instance) IsReady

func (self Instance) IsReady() bool

If Instance.Threaded is enabled, returns true if the background thread has finished text processing, otherwise always return true.

func (Instance) JustificationFlags

func (self Instance) JustificationFlags() TextServer.JustificationFlag

func (Instance) Language

func (self Instance) Language() string

func (Instance) MenuOption

func (self Instance) MenuOption(option int)

Executes a given action as defined in the MenuItems enum.

func (Instance) MetaUnderlined

func (self Instance) MetaUnderlined() bool

func (Instance) Newline

func (self Instance) Newline()

Adds a newline tag to the tag stack.

func (Instance) OnFinished

func (self Instance) OnFinished(cb func(), flags ...Signal.Flags)

func (Instance) OnMetaClicked

func (self Instance) OnMetaClicked(cb func(meta any), flags ...Signal.Flags)

func (Instance) OnMetaHoverEnded

func (self Instance) OnMetaHoverEnded(cb func(meta any), flags ...Signal.Flags)

func (Instance) OnMetaHoverStarted

func (self Instance) OnMetaHoverStarted(cb func(meta any), flags ...Signal.Flags)

func (Instance) ParseBbcode

func (self Instance) ParseBbcode(bbcode string)

The assignment version of Instance.AppendText. Clears the tag stack and inserts the new content.

func (Instance) ParseExpressionsForValues

func (self Instance) ParseExpressionsForValues(expressions []string) map[string]interface{}

Parses BBCode parameter 'expressions' into a dictionary.

func (Instance) Pop

func (self Instance) Pop()

Terminates the current tag. Use after push_* methods to close BBCodes manually. Does not need to follow add_* methods.

func (Instance) PopAll

func (self Instance) PopAll()

Terminates all tags opened by push_* methods.

func (Instance) PopContext

func (self Instance) PopContext()

Terminates tags opened after the last Instance.PushContext call (including context marker), or all tags if there's no context marker on the stack.

func (Instance) ProgressBarDelay

func (self Instance) ProgressBarDelay() int

func (Instance) PushBgcolor

func (self Instance) PushBgcolor(bgcolor Color.RGBA)

Adds a [bgcolor] tag to the tag stack.

func (Instance) PushBold

func (self Instance) PushBold()

Adds a [font] tag with a bold font to the tag stack. This is the same as adding a [b] tag if not currently in a [i] tag.

func (Instance) PushBoldItalics

func (self Instance) PushBoldItalics()

Adds a [font] tag with a bold italics font to the tag stack.

func (Instance) PushCell

func (self Instance) PushCell()

Adds a [cell] tag to the tag stack. Must be inside a [table] tag. See Instance.PushTable for details. Use Instance.SetTableColumnExpand to set column expansion ratio, Instance.SetCellBorderColor to set cell border, Instance.SetCellRowBackgroundColor to set cell background, Instance.SetCellSizeOverride to override cell size, and Instance.SetCellPadding to set padding.

func (Instance) PushColor

func (self Instance) PushColor(color Color.RGBA)

Adds a [color] tag to the tag stack.

func (Instance) PushContext

func (self Instance) PushContext()

Adds a context marker to the tag stack. See Instance.PopContext.

func (Instance) PushCustomfx

func (self Instance) PushCustomfx(effect RichTextEffect.Instance, env map[string]interface{})

Adds a custom effect tag to the tag stack. The effect does not need to be in Instance.CustomEffects. The environment is directly passed to the effect.

func (Instance) PushDropcap

func (self Instance) PushDropcap(s string, font Font.Instance, size int)

Adds a [dropcap] 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

func (self Instance) PushFgcolor(fgcolor Color.RGBA)

Adds a [fgcolor] tag to the tag stack.

func (Instance) PushFont

func (self Instance) PushFont(font Font.Instance)

Adds a [font] tag to the tag stack. Overrides default fonts for its duration.

Passing 0 to 'font_size' will use the existing default font size.

func (Instance) PushFontSize

func (self Instance) PushFontSize(font_size int)

Adds a [font_size] tag to the tag stack. Overrides default font size for its duration.

func (Instance) PushHint

func (self Instance) PushHint(description string)

Adds a [hint] tag to the tag stack. Same as BBCode [hint=something]{text}[/hint].

func (Instance) PushIndent

func (self Instance) PushIndent(level int)

Adds an [indent] tag to the tag stack. Multiplies 'level' by current Instance.TabSize to determine new margin length.

func (Instance) PushItalics

func (self Instance) PushItalics()

Adds a [font] tag with an italics font to the tag stack. This is the same as adding an [i] tag if not currently in a [b] tag.

func (Instance) PushLanguage

func (self Instance) PushLanguage(language string)

Adds language code used for text shaping algorithm and Open-Type font features.

func (Instance) PushList

func (self Instance) PushList(level int, atype ListType, capitalize bool)

Adds [ol] or [ul] tag to the tag stack. Multiplies 'level' by current Instance.TabSize to determine new margin length.

func (Instance) PushMeta

func (self Instance) PushMeta(data any)

Adds a meta tag to the tag stack. Similar to the BBCode [url=something]{text}[/url], but supports non-string metadata types.

If Instance.MetaUnderlined is true, meta tags display an underline. This behavior can be customized with 'underline_mode'.

Note: Meta tags do nothing by default when clicked. To assign behavior when clicked, connect Instance.OnMetaClicked to a function that is called when the meta tag is clicked.

func (Instance) PushMono

func (self Instance) PushMono()

Adds a [font] tag with a monospace font to the tag stack.

func (Instance) PushNormal

func (self Instance) PushNormal()

Adds a [font] tag with a normal font to the tag stack.

func (Instance) PushOutlineColor

func (self Instance) PushOutlineColor(color Color.RGBA)

Adds a [outline_color] tag to the tag stack. Adds text outline for its duration.

func (Instance) PushOutlineSize

func (self Instance) PushOutlineSize(outline_size int)

Adds a [outline_size] tag to the tag stack. Overrides default text outline size for its duration.

func (Instance) PushParagraph

func (self Instance) PushParagraph(alignment GUI.HorizontalAlignment)

Adds a [p] tag to the tag stack.

func (Instance) PushStrikethrough

func (self Instance) PushStrikethrough()

Adds a [s] tag to the tag stack.

func (Instance) PushTable

func (self Instance) PushTable(columns int)

Adds a [table=columns,inline_align] tag to the tag stack. Use Instance.SetTableColumnExpand to set column expansion ratio. Use Instance.PushCell to add cells.

func (Instance) PushUnderline

func (self Instance) PushUnderline()

Adds a [u] tag to the tag stack.

func (Instance) RemoveParagraph

func (self Instance) RemoveParagraph(paragraph int) bool

Removes a paragraph of content from the label. Returns true if the paragraph exists.

The 'paragraph' argument is the index of the paragraph to remove, it can take values in the interval [0, get_paragraph_count() - 1].

If 'no_invalidate' is set to true, 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 Instance.InvalidateParagraph will be called at the end of operation.

func (Instance) ScrollActive

func (self Instance) ScrollActive() bool

func (Instance) ScrollFollowing

func (self Instance) ScrollFollowing() bool

func (Instance) ScrollToLine

func (self Instance) ScrollToLine(line int)

Scrolls the window's top line to match 'line'.

func (Instance) ScrollToParagraph

func (self Instance) ScrollToParagraph(paragraph int)

Scrolls the window's top line to match first line of the '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 Instance.SelectionEnabled is false, no selection will occur.

func (Instance) SelectionEnabled

func (self Instance) SelectionEnabled() bool

func (Instance) SetAutowrapMode

func (self Instance) SetAutowrapMode(value TextServer.AutowrapMode)

func (Instance) SetBbcodeEnabled

func (self Instance) SetBbcodeEnabled(value bool)

func (Instance) SetCellBorderColor

func (self Instance) SetCellBorderColor(color Color.RGBA)

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

func (self Instance) SetCellRowBackgroundColor(odd_row_bg Color.RGBA, even_row_bg Color.RGBA)

Sets color of a table cell. Separate colors for alternating rows can be specified.

func (Instance) SetCellSizeOverride

func (self Instance) SetCellSizeOverride(min_size Vector2.XY, max_size Vector2.XY)

Sets minimum and maximum size overrides for a table cell.

func (Instance) SetContextMenuEnabled

func (self Instance) SetContextMenuEnabled(value bool)

func (Instance) SetCustomEffects

func (self Instance) SetCustomEffects(value []any)

func (Instance) SetDeselectOnFocusLossEnabled

func (self Instance) SetDeselectOnFocusLossEnabled(value bool)

func (Instance) SetDragAndDropSelectionEnabled

func (self Instance) SetDragAndDropSelectionEnabled(value bool)

func (Instance) SetFitContent

func (self Instance) SetFitContent(value bool)

func (Instance) SetHintUnderlined

func (self Instance) SetHintUnderlined(value bool)

func (Instance) SetHorizontalAlignment

func (self Instance) SetHorizontalAlignment(value GUI.HorizontalAlignment)

func (Instance) SetJustificationFlags

func (self Instance) SetJustificationFlags(value TextServer.JustificationFlag)

func (Instance) SetLanguage

func (self Instance) SetLanguage(value string)

func (Instance) SetMetaUnderlined

func (self Instance) SetMetaUnderlined(value bool)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetProgressBarDelay

func (self Instance) SetProgressBarDelay(value int)

func (Instance) SetScrollActive

func (self Instance) SetScrollActive(value bool)

func (Instance) SetScrollFollowing

func (self Instance) SetScrollFollowing(value bool)

func (Instance) SetSelectionEnabled

func (self Instance) SetSelectionEnabled(value bool)

func (Instance) SetShortcutKeysEnabled

func (self Instance) SetShortcutKeysEnabled(value bool)

func (Instance) SetStructuredTextBidiOverride

func (self Instance) SetStructuredTextBidiOverride(value TextServer.StructuredTextParser)

func (Instance) SetStructuredTextBidiOverrideOptions

func (self Instance) SetStructuredTextBidiOverrideOptions(value []any)

func (Instance) SetTabSize

func (self Instance) SetTabSize(value int)

func (Instance) SetTabStops

func (self Instance) SetTabStops(value []float32)

func (Instance) SetTableColumnExpand

func (self Instance) SetTableColumnExpand(column int, expand bool)

Edits the selected column's expansion options. If 'expand' is true, 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 'expand' is false, the column will not contribute to the total ratio.

func (Instance) SetText

func (self Instance) SetText(value string)

func (Instance) SetTextDirection

func (self Instance) SetTextDirection(value Control.TextDirection)

func (Instance) SetThreaded

func (self Instance) SetThreaded(value bool)

func (Instance) SetVerticalAlignment

func (self Instance) SetVerticalAlignment(value GUI.VerticalAlignment)

func (Instance) SetVisibleCharacters

func (self Instance) SetVisibleCharacters(value int)

func (Instance) SetVisibleCharactersBehavior

func (self Instance) SetVisibleCharactersBehavior(value TextServer.VisibleCharactersBehavior)

func (Instance) SetVisibleRatio

func (self Instance) SetVisibleRatio(value Float.X)

func (Instance) ShortcutKeysEnabled

func (self Instance) ShortcutKeysEnabled() bool

func (Instance) StructuredTextBidiOverride

func (self Instance) StructuredTextBidiOverride() TextServer.StructuredTextParser

func (Instance) StructuredTextBidiOverrideOptions

func (self Instance) StructuredTextBidiOverrideOptions() []any

func (Instance) TabSize

func (self Instance) TabSize() int

func (Instance) TabStops

func (self Instance) TabStops() []float32

func (Instance) Text

func (self Instance) Text() string

func (Instance) TextDirection

func (self Instance) TextDirection() Control.TextDirection

func (Instance) Threaded

func (self Instance) Threaded() bool

func (Instance) UpdateImage

func (self Instance) UpdateImage(key any, mask ImageUpdateMask, image Texture2D.Instance)

Updates the existing images with the key 'key'. Only properties specified by 'mask' bits are updated. See Instance.AddImage.

func (Instance) VerticalAlignment

func (self Instance) VerticalAlignment() GUI.VerticalAlignment

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) VisibleCharacters

func (self Instance) VisibleCharacters() int

func (Instance) VisibleCharactersBehavior

func (self Instance) VisibleCharactersBehavior() TextServer.VisibleCharactersBehavior

func (Instance) VisibleRatio

func (self Instance) VisibleRatio() Float.X

type ListType

type ListType int //gd:RichTextLabel.ListType
const (
	// Each list item has a number marker.
	ListNumbers ListType = 0
	// Each list item has a letter marker.
	ListLetters ListType = 1
	// Each list item has a roman number marker.
	ListRoman ListType = 2
	// Each list item has a filled circle marker.
	ListDots ListType = 3
)
type MenuItems int //gd:RichTextLabel.MenuItems
const (
	// Copies the selected text.
	MenuCopy MenuItems = 0
	// Selects the whole [graphics.gd/classdb/RichTextLabel] text.
	MenuSelectAll MenuItems = 1
	// Represents the size of the [MenuItems] enum.
	MenuMax MenuItems = 2
)

type MetaUnderline

type MetaUnderline int //gd:RichTextLabel.MetaUnderline
const (
	// Meta tag does not display an underline, even if [Instance.MetaUnderlined] is true.
	MetaUnderlineNever MetaUnderline = 0
	// If [Instance.MetaUnderlined] is true, meta tag always display an underline.
	MetaUnderlineAlways MetaUnderline = 1
	// If [Instance.MetaUnderlined] is true, meta tag display an underline when the mouse cursor is over it.
	MetaUnderlineOnHover MetaUnderline = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL