TextMesh

package
v0.0.0-...-357ca8a Latest Latest
Warning

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

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

Documentation

Overview

Generate a PrimitiveMesh from the text.

TextMesh can be generated only when using dynamic fonts with vector glyph contours. Bitmap fonts (including bitmap data in the TrueType/OpenType containers, like color emoji fonts) are not supported.

The UV layout is arranged in 4 horizontal strips, top to bottom: 40% of the height for the front face, 40% for the back face, 10% for the outer edges and 10% for the inner edges.

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

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

func (self *Extension[T]) AsMesh() Mesh.Instance

func (*Extension[T]) AsObject

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

func (*Extension[T]) AsPrimitiveMesh

func (self *Extension[T]) AsPrimitiveMesh() PrimitiveMesh.Instance

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

func (*Extension[T]) AsTextMesh

func (self *Extension[T]) AsTextMesh() 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 Instance

type Instance [1]gdclass.TextMesh

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

func (self Instance) AsMesh() Mesh.Instance

func (Instance) AsObject

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

func (Instance) AsPrimitiveMesh

func (self Instance) AsPrimitiveMesh() PrimitiveMesh.Instance

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsTextMesh

func (self Instance) AsTextMesh() Instance

func (Instance) AutowrapMode

func (self Instance) AutowrapMode() TextServer.AutowrapMode

If set to something other than [Textserver.AutowrapOff], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text.

func (Instance) CurveStep

func (self Instance) CurveStep() Float.X

Step (in pixels) used to approximate Bézier curves.

func (Instance) Depth

func (self Instance) Depth() Float.X

Depths of the mesh, if set to 0.0 only front surface, is generated, and UV layout is changed to use full texture for the front face only.

func (Instance) Font

func (self Instance) Font() Font.Instance

Font configuration used to display text.

func (Instance) FontSize

func (self Instance) FontSize() int

Font size of the TextMesh's text.

func (Instance) HorizontalAlignment

func (self Instance) HorizontalAlignment() GUI.HorizontalAlignment

Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) JustificationFlags

func (self Instance) JustificationFlags() TextServer.JustificationFlag

Line fill alignment rules.

func (Instance) Language

func (self Instance) Language() string

Language code used for text shaping algorithms, if left empty current locale is used instead.

func (Instance) LineSpacing

func (self Instance) LineSpacing() Float.X

Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.

func (Instance) Offset

func (self Instance) Offset() Vector2.XY

The text drawing offset (in pixels).

func (Instance) PixelSize

func (self Instance) PixelSize() Float.X

The size of one pixel's width on the text to scale it in 3D.

func (Instance) SetAutowrapMode

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

SetAutowrapMode sets the property returned by [GetAutowrapMode].

func (Instance) SetCurveStep

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

SetCurveStep sets the property returned by [GetCurveStep].

func (Instance) SetDepth

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

SetDepth sets the property returned by [GetDepth].

func (Instance) SetFont

func (self Instance) SetFont(value Font.Instance)

SetFont sets the property returned by [GetFont].

func (Instance) SetFontSize

func (self Instance) SetFontSize(value int)

SetFontSize sets the property returned by [GetFontSize].

func (Instance) SetHorizontalAlignment

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

SetHorizontalAlignment sets the property returned by [GetHorizontalAlignment].

func (Instance) SetJustificationFlags

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

SetJustificationFlags sets the property returned by [GetJustificationFlags].

func (Instance) SetLanguage

func (self Instance) SetLanguage(value string)

SetLanguage sets the property returned by [GetLanguage].

func (Instance) SetLineSpacing

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

SetLineSpacing sets the property returned by [GetLineSpacing].

func (*Instance) SetObject

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

func (Instance) SetOffset

func (self Instance) SetOffset(value Vector2.XY)

SetOffset sets the property returned by [GetOffset].

func (Instance) SetPixelSize

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

SetPixelSize sets the property returned by [GetPixelSize].

func (Instance) SetStructuredTextBidiOverride

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

SetStructuredTextBidiOverride sets the property returned by [GetStructuredTextBidiOverride].

func (Instance) SetStructuredTextBidiOverrideOptions

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

SetStructuredTextBidiOverrideOptions sets the property returned by [GetStructuredTextBidiOverrideOptions].

func (Instance) SetText

func (self Instance) SetText(value string)

SetText sets the property returned by [GetText].

func (Instance) SetTextDirection

func (self Instance) SetTextDirection(value TextServer.Direction)

SetTextDirection sets the property returned by [GetTextDirection].

func (Instance) SetUppercase

func (self Instance) SetUppercase(value bool)

SetUppercase sets the property returned by [IsUppercase].

func (Instance) SetVerticalAlignment

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

SetVerticalAlignment sets the property returned by [GetVerticalAlignment].

func (Instance) SetWidth

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

SetWidth sets the property returned by [GetWidth].

func (Instance) StructuredTextBidiOverride

func (self Instance) StructuredTextBidiOverride() TextServer.StructuredTextParser

Set BiDi algorithm override for the structured text.

func (Instance) StructuredTextBidiOverrideOptions

func (self Instance) StructuredTextBidiOverrideOptions() []any

Set additional options for BiDi override.

func (Instance) Text

func (self Instance) Text() string

The text to generate mesh from.

Note: Due to being a Resource, it doesn't follow the rules of Node.AutoTranslateMode. If disabling translation is desired, it should be done manually with Object.SetMessageTranslation.

func (Instance) TextDirection

func (self Instance) TextDirection() TextServer.Direction

Base text writing direction.

func (Instance) Uppercase

func (self Instance) Uppercase() bool

If true, all the text displays as UPPERCASE.

func (Instance) VerticalAlignment

func (self Instance) VerticalAlignment() GUI.VerticalAlignment

Controls the text's vertical alignment. Supports top, center, and bottom.

func (Instance) Virtual

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

func (Instance) Width

func (self Instance) Width() Float.X

Text width (in pixels), used for fill alignment.

Jump to

Keyboard shortcuts

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