Label

package
v0.0.0-...-5eaf078 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package Label provides methods for working with Label object instances.

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
	AsLabel() Instance
}

type Expanded

type Expanded [1]gdclass.Label

func (Expanded) GetLineHeight

func (self Expanded) GetLineHeight(line int) int

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

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]) AsLabel

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

func (*Extension[T]) AsNode

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

func (*Extension[T]) AsObject

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

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 Instance

type Instance [1]gdclass.Label

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 New

func New() Instance

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsLabel

func (self Instance) AsLabel() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

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

func (Instance) AutowrapMode

func (self Instance) AutowrapMode() TextServer.AutowrapMode

func (Instance) ClipText

func (self Instance) ClipText() bool

func (Instance) EllipsisChar

func (self Instance) EllipsisChar() string

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

func (self Instance) GetLineCount() int

Returns the number of lines of text the Label has.

func (Instance) GetLineHeight

func (self Instance) GetLineHeight() int

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

func (self Instance) GetTotalCharacterCount() int

Returns the total number of printable characters in the text (excluding spaces and newlines).

func (Instance) GetVisibleLineCount

func (self Instance) GetVisibleLineCount() int

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) ID

func (self Instance) ID() ID

func (Instance) JustificationFlags

func (self Instance) JustificationFlags() TextServer.JustificationFlag

func (Instance) LabelSettings

func (self Instance) LabelSettings() LabelSettings.Instance

func (Instance) Language

func (self Instance) Language() string

func (Instance) LinesSkipped

func (self Instance) LinesSkipped() int

func (Instance) MaxLinesVisible

func (self Instance) MaxLinesVisible() int

func (Instance) ParagraphSeparator

func (self Instance) ParagraphSeparator() string

func (Instance) SetAutowrapMode

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

func (Instance) SetClipText

func (self Instance) SetClipText(value bool)

func (Instance) SetEllipsisChar

func (self Instance) SetEllipsisChar(value string)

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 (self Instance) SetLanguage(value string)

func (Instance) SetLinesSkipped

func (self Instance) SetLinesSkipped(value int)

func (Instance) SetMaxLinesVisible

func (self Instance) SetMaxLinesVisible(value int)

func (*Instance) SetObject

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

func (Instance) SetParagraphSeparator

func (self Instance) SetParagraphSeparator(value string)

func (Instance) SetStructuredTextBidiOverride

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

func (Instance) SetStructuredTextBidiOverrideOptions

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

func (Instance) SetTabStops

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

func (Instance) SetText

func (self Instance) SetText(value string)

func (Instance) SetTextDirection

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

func (Instance) SetTextOverrunBehavior

func (self Instance) SetTextOverrunBehavior(value TextServer.OverrunBehavior)

func (Instance) SetUppercase

func (self Instance) SetUppercase(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) StructuredTextBidiOverride

func (self Instance) StructuredTextBidiOverride() TextServer.StructuredTextParser

func (Instance) StructuredTextBidiOverrideOptions

func (self Instance) StructuredTextBidiOverrideOptions() []any

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) TextOverrunBehavior

func (self Instance) TextOverrunBehavior() TextServer.OverrunBehavior

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Uppercase

func (self Instance) Uppercase() bool

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

Jump to

Keyboard shortcuts

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