Label

package
v0.0.0-...-f3deeb4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 23 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 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 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() gdclass.TextServerAutowrapMode

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]. 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() HorizontalAlignment

func (Instance) JustificationFlags

func (self Instance) JustificationFlags() gdclass.TextServerJustificationFlag

func (Instance) LabelSettings

func (self Instance) LabelSettings() [1]gdclass.LabelSettings

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

func (self Instance) SetAutowrapMode(value gdclass.TextServerAutowrapMode)

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

func (Instance) SetJustificationFlags

func (self Instance) SetJustificationFlags(value gdclass.TextServerJustificationFlag)

func (Instance) SetLabelSettings

func (self Instance) SetLabelSettings(value [1]gdclass.LabelSettings)

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

func (self Instance) SetStructuredTextBidiOverride(value gdclass.TextServerStructuredTextParser)

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 gdclass.ControlTextDirection)

func (Instance) SetTextOverrunBehavior

func (self Instance) SetTextOverrunBehavior(value gdclass.TextServerOverrunBehavior)

func (Instance) SetUppercase

func (self Instance) SetUppercase(value bool)

func (Instance) SetVerticalAlignment

func (self Instance) SetVerticalAlignment(value VerticalAlignment)

func (Instance) SetVisibleCharacters

func (self Instance) SetVisibleCharacters(value int)

func (Instance) SetVisibleCharactersBehavior

func (self Instance) SetVisibleCharactersBehavior(value gdclass.TextServerVisibleCharactersBehavior)

func (Instance) SetVisibleRatio

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

func (Instance) StructuredTextBidiOverride

func (self Instance) StructuredTextBidiOverride() gdclass.TextServerStructuredTextParser

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() gdclass.ControlTextDirection

func (Instance) TextOverrunBehavior

func (self Instance) TextOverrunBehavior() gdclass.TextServerOverrunBehavior

func (*Instance) UnsafePointer

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

func (Instance) Uppercase

func (self Instance) Uppercase() bool

func (Instance) VerticalAlignment

func (self Instance) VerticalAlignment() 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() gdclass.TextServerVisibleCharactersBehavior

func (Instance) VisibleRatio

func (self Instance) VisibleRatio() Float.X

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
)

Jump to

Keyboard shortcuts

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