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 ¶
- type Advanced
- type Any
- type Extension
- func (self *Extension[T]) AsMesh() Mesh.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- func (self *Extension[T]) AsPrimitiveMesh() PrimitiveMesh.Instance
- func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
- func (self *Extension[T]) AsResource() Resource.Instance
- func (self *Extension[T]) AsTextMesh() Instance
- type ID
- type Instance
- func (self Instance) AsMesh() Mesh.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsPrimitiveMesh() PrimitiveMesh.Instance
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AsTextMesh() Instance
- func (self Instance) AutowrapMode() TextServer.AutowrapMode
- func (self Instance) CurveStep() Float.X
- func (self Instance) Depth() Float.X
- func (self Instance) Font() Font.Instance
- func (self Instance) FontSize() int
- func (self Instance) HorizontalAlignment() GUI.HorizontalAlignment
- func (self Instance) ID() ID
- func (self Instance) JustificationFlags() TextServer.JustificationFlag
- func (self Instance) Language() string
- func (self Instance) LineSpacing() Float.X
- func (self Instance) Offset() Vector2.XY
- func (self Instance) PixelSize() Float.X
- func (self Instance) SetAutowrapMode(value TextServer.AutowrapMode)
- func (self Instance) SetCurveStep(value Float.X)
- func (self Instance) SetDepth(value Float.X)
- func (self Instance) SetFont(value Font.Instance)
- func (self Instance) SetFontSize(value int)
- func (self Instance) SetHorizontalAlignment(value GUI.HorizontalAlignment)
- func (self Instance) SetJustificationFlags(value TextServer.JustificationFlag)
- func (self Instance) SetLanguage(value string)
- func (self Instance) SetLineSpacing(value Float.X)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOffset(value Vector2.XY)
- func (self Instance) SetPixelSize(value Float.X)
- func (self Instance) SetStructuredTextBidiOverride(value TextServer.StructuredTextParser)
- func (self Instance) SetStructuredTextBidiOverrideOptions(value []any)
- func (self Instance) SetText(value string)
- func (self Instance) SetTextDirection(value TextServer.Direction)
- func (self Instance) SetUppercase(value bool)
- func (self Instance) SetVerticalAlignment(value GUI.VerticalAlignment)
- func (self Instance) SetWidth(value Float.X)
- func (self Instance) StructuredTextBidiOverride() TextServer.StructuredTextParser
- func (self Instance) StructuredTextBidiOverrideOptions() []any
- func (self Instance) Text() string
- func (self Instance) TextDirection() TextServer.Direction
- func (self Instance) Uppercase() bool
- func (self Instance) VerticalAlignment() GUI.VerticalAlignment
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) Width() 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 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]) 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 (*Extension[T]) AsTextMesh ¶
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 ¶
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 (Instance) AsPrimitiveMesh ¶
func (self Instance) AsPrimitiveMesh() PrimitiveMesh.Instance
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) AsTextMesh ¶
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) Depth ¶
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) HorizontalAlignment ¶
func (self Instance) HorizontalAlignment() GUI.HorizontalAlignment
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify.
func (Instance) JustificationFlags ¶
func (self Instance) JustificationFlags() TextServer.JustificationFlag
Line fill alignment rules.
func (Instance) Language ¶
Language code used for text shaping algorithms, if left empty current locale is used instead.
func (Instance) LineSpacing ¶
Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
func (Instance) SetAutowrapMode ¶
func (self Instance) SetAutowrapMode(value TextServer.AutowrapMode)
SetAutowrapMode sets the property returned by [GetAutowrapMode].
func (Instance) SetCurveStep ¶
SetCurveStep sets the property returned by [GetCurveStep].
func (Instance) SetFontSize ¶
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 ¶
SetLanguage sets the property returned by [GetLanguage].
func (Instance) SetLineSpacing ¶
SetLineSpacing sets the property returned by [GetLineSpacing].
func (Instance) SetPixelSize ¶
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 ¶
SetStructuredTextBidiOverrideOptions sets the property returned by [GetStructuredTextBidiOverrideOptions].
func (Instance) SetTextDirection ¶
func (self Instance) SetTextDirection(value TextServer.Direction)
SetTextDirection sets the property returned by [GetTextDirection].
func (Instance) SetUppercase ¶
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) StructuredTextBidiOverride ¶
func (self Instance) StructuredTextBidiOverride() TextServer.StructuredTextParser
Set BiDi algorithm override for the structured text.
func (Instance) StructuredTextBidiOverrideOptions ¶
Set additional options for BiDi override.
func (Instance) Text ¶
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) VerticalAlignment ¶
func (self Instance) VerticalAlignment() GUI.VerticalAlignment
Controls the text's vertical alignment. Supports top, center, and bottom.