Documentation
¶
Overview ¶
Package Label provides methods for working with Label object instances.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsLabel() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AutowrapMode() TextServer.AutowrapMode
- func (self Instance) ClipText() bool
- func (self Instance) EllipsisChar() string
- func (self Instance) GetCharacterBounds(pos int) Rect2.PositionSize
- func (self Instance) GetLineCount() int
- func (self Instance) GetLineHeight() int
- func (self Instance) GetTotalCharacterCount() int
- func (self Instance) GetVisibleLineCount() int
- func (self Instance) HorizontalAlignment() GUI.HorizontalAlignment
- func (self Instance) ID() ID
- func (self Instance) JustificationFlags() TextServer.JustificationFlag
- func (self Instance) LabelSettings() LabelSettings.Instance
- func (self Instance) Language() string
- func (self Instance) LinesSkipped() int
- func (self Instance) MaxLinesVisible() int
- func (self Instance) ParagraphSeparator() string
- func (self Instance) SetAutowrapMode(value TextServer.AutowrapMode)
- func (self Instance) SetClipText(value bool)
- func (self Instance) SetEllipsisChar(value string)
- func (self Instance) SetHorizontalAlignment(value GUI.HorizontalAlignment)
- func (self Instance) SetJustificationFlags(value TextServer.JustificationFlag)
- func (self Instance) SetLabelSettings(value LabelSettings.Instance)
- func (self Instance) SetLanguage(value string)
- func (self Instance) SetLinesSkipped(value int)
- func (self Instance) SetMaxLinesVisible(value int)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetParagraphSeparator(value string)
- func (self Instance) SetStructuredTextBidiOverride(value TextServer.StructuredTextParser)
- func (self Instance) SetStructuredTextBidiOverrideOptions(value []any)
- func (self Instance) SetTabStops(value []float32)
- func (self Instance) SetText(value string)
- func (self Instance) SetTextDirection(value Control.TextDirection)
- func (self Instance) SetTextOverrunBehavior(value TextServer.OverrunBehavior)
- func (self Instance) SetUppercase(value bool)
- func (self Instance) SetVerticalAlignment(value GUI.VerticalAlignment)
- func (self Instance) SetVisibleCharacters(value int)
- func (self Instance) SetVisibleCharactersBehavior(value TextServer.VisibleCharactersBehavior)
- func (self Instance) SetVisibleRatio(value Float.X)
- func (self Instance) StructuredTextBidiOverride() TextServer.StructuredTextParser
- func (self Instance) StructuredTextBidiOverrideOptions() []any
- func (self Instance) TabStops() []float32
- func (self Instance) Text() string
- func (self Instance) TextDirection() Control.TextDirection
- func (self Instance) TextOverrunBehavior() TextServer.OverrunBehavior
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Uppercase() bool
- func (self Instance) VerticalAlignment() GUI.VerticalAlignment
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) VisibleCharacters() int
- func (self Instance) VisibleCharactersBehavior() TextServer.VisibleCharactersBehavior
- func (self Instance) VisibleRatio() Float.X
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 Expanded ¶
func (Expanded) GetLineHeight ¶
Returns the height of the line [param line]. If [param line] is set to [code]-1[/code], returns the biggest line height. If there are no lines, returns font size in pixels.
type Extension ¶
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
type 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.
type Instance ¶
A control for displaying plain text. It gives you control over the horizontal and vertical alignment and can wrap the text inside the node's bounding rectangle. It doesn't support bold, italics, or other rich text formatting. For that, use [RichTextLabel] instead.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) AutowrapMode ¶
func (self Instance) AutowrapMode() TextServer.AutowrapMode
func (Instance) EllipsisChar ¶
func (Instance) GetCharacterBounds ¶
func (self Instance) GetCharacterBounds(pos int) Rect2.PositionSize
Returns the bounding rectangle of the character at position [param pos] in the label's local coordinate system. If the character is a non-visual character or [param pos] is outside the valid range, an empty [Rect2] is returned. If the character is a part of a composite grapheme, the bounding rectangle of the whole grapheme is returned.
func (Instance) GetLineCount ¶
Returns the number of lines of text the Label has.
func (Instance) GetLineHeight ¶
Returns the height of the line [param line]. If [param line] is set to [code]-1[/code], returns the biggest line height. If there are no lines, returns font size in pixels.
func (Instance) GetTotalCharacterCount ¶
Returns the total number of printable characters in the text (excluding spaces and newlines).
func (Instance) GetVisibleLineCount ¶
Returns the number of lines shown. Useful if the [Label]'s height cannot currently display all lines.
func (Instance) HorizontalAlignment ¶
func (self Instance) HorizontalAlignment() GUI.HorizontalAlignment
func (Instance) JustificationFlags ¶
func (self Instance) JustificationFlags() TextServer.JustificationFlag
func (Instance) LabelSettings ¶
func (self Instance) LabelSettings() LabelSettings.Instance
func (Instance) LinesSkipped ¶
func (Instance) MaxLinesVisible ¶
func (Instance) ParagraphSeparator ¶
func (Instance) SetAutowrapMode ¶
func (self Instance) SetAutowrapMode(value TextServer.AutowrapMode)
func (Instance) SetClipText ¶
func (Instance) SetEllipsisChar ¶
func (Instance) SetHorizontalAlignment ¶
func (self Instance) SetHorizontalAlignment(value GUI.HorizontalAlignment)
func (Instance) SetJustificationFlags ¶
func (self Instance) SetJustificationFlags(value TextServer.JustificationFlag)
func (Instance) SetLabelSettings ¶
func (self Instance) SetLabelSettings(value LabelSettings.Instance)
func (Instance) SetLanguage ¶
func (Instance) SetLinesSkipped ¶
func (Instance) SetMaxLinesVisible ¶
func (Instance) SetParagraphSeparator ¶
func (Instance) SetStructuredTextBidiOverride ¶
func (self Instance) SetStructuredTextBidiOverride(value TextServer.StructuredTextParser)
func (Instance) SetStructuredTextBidiOverrideOptions ¶
func (Instance) SetTabStops ¶
func (Instance) SetTextDirection ¶
func (self Instance) SetTextDirection(value Control.TextDirection)
func (Instance) SetTextOverrunBehavior ¶
func (self Instance) SetTextOverrunBehavior(value TextServer.OverrunBehavior)
func (Instance) SetUppercase ¶
func (Instance) SetVerticalAlignment ¶
func (self Instance) SetVerticalAlignment(value GUI.VerticalAlignment)
func (Instance) SetVisibleCharacters ¶
func (Instance) SetVisibleCharactersBehavior ¶
func (self Instance) SetVisibleCharactersBehavior(value TextServer.VisibleCharactersBehavior)
func (Instance) SetVisibleRatio ¶
func (Instance) StructuredTextBidiOverride ¶
func (self Instance) StructuredTextBidiOverride() TextServer.StructuredTextParser
func (Instance) StructuredTextBidiOverrideOptions ¶
func (Instance) TextDirection ¶
func (self Instance) TextDirection() Control.TextDirection
func (Instance) TextOverrunBehavior ¶
func (self Instance) TextOverrunBehavior() TextServer.OverrunBehavior
func (*Instance) UnsafePointer ¶
func (Instance) VerticalAlignment ¶
func (self Instance) VerticalAlignment() GUI.VerticalAlignment
func (Instance) VisibleCharacters ¶
func (Instance) VisibleCharactersBehavior ¶
func (self Instance) VisibleCharactersBehavior() TextServer.VisibleCharactersBehavior