Documentation
¶
Overview ¶
Package TextParagraph provides methods for working with TextParagraph object instances.
Index ¶
- type Advanced
- type Any
- type HorizontalAlignment
- type InlineAlignment
- type Instance
- func (self Instance) AddObject(key any, size Vector2.XY) bool
- func (self Instance) AddString(text string, font [1]gdclass.Font, font_size int) bool
- func (self Instance) Alignment() HorizontalAlignment
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsTextParagraph() Instance
- func (self Instance) BreakFlags() gdclass.TextServerLineBreakFlag
- func (self Instance) Clear()
- func (self Instance) ClearDropcap()
- func (self Instance) CustomPunctuation() string
- func (self Instance) Direction() gdclass.TextServerDirection
- func (self Instance) Draw(canvas RID.Canvas, pos Vector2.XY)
- func (self Instance) DrawDropcap(canvas RID.Canvas, pos Vector2.XY)
- func (self Instance) DrawDropcapOutline(canvas RID.Canvas, pos Vector2.XY)
- func (self Instance) DrawLine(canvas RID.Canvas, pos Vector2.XY, line int)
- func (self Instance) DrawLineOutline(canvas RID.Canvas, pos Vector2.XY, line int)
- func (self Instance) DrawOutline(canvas RID.Canvas, pos Vector2.XY)
- func (self Instance) EllipsisChar() string
- func (self Instance) GetDropcapLines() int
- func (self Instance) GetDropcapRid() RID.TextBuffer
- func (self Instance) GetDropcapSize() Vector2.XY
- func (self Instance) GetLineAscent(line int) Float.X
- func (self Instance) GetLineCount() int
- func (self Instance) GetLineDescent(line int) Float.X
- func (self Instance) GetLineObjectRect(line int, key any) Rect2.PositionSize
- func (self Instance) GetLineObjects(line int) []any
- func (self Instance) GetLineRange(line int) Vector2i.XY
- func (self Instance) GetLineRid(line int) RID.TextBuffer
- func (self Instance) GetLineSize(line int) Vector2.XY
- func (self Instance) GetLineUnderlinePosition(line int) Float.X
- func (self Instance) GetLineUnderlineThickness(line int) Float.X
- func (self Instance) GetLineWidth(line int) Float.X
- func (self Instance) GetNonWrappedSize() Vector2.XY
- func (self Instance) GetRid() RID.TextBuffer
- func (self Instance) GetSize() Vector2.XY
- func (self Instance) HitTest(coords Vector2.XY) int
- func (self Instance) JustificationFlags() gdclass.TextServerJustificationFlag
- func (self Instance) MaxLinesVisible() int
- func (self Instance) Orientation() gdclass.TextServerOrientation
- func (self Instance) PreserveControl() bool
- func (self Instance) PreserveInvalid() bool
- func (self Instance) ResizeObject(key any, size Vector2.XY) bool
- func (self Instance) SetAlignment(value HorizontalAlignment)
- func (self Instance) SetBidiOverride(override []any)
- func (self Instance) SetBreakFlags(value gdclass.TextServerLineBreakFlag)
- func (self Instance) SetCustomPunctuation(value string)
- func (self Instance) SetDirection(value gdclass.TextServerDirection)
- func (self Instance) SetDropcap(text string, font [1]gdclass.Font, font_size int) bool
- func (self Instance) SetEllipsisChar(value string)
- func (self Instance) SetJustificationFlags(value gdclass.TextServerJustificationFlag)
- func (self Instance) SetMaxLinesVisible(value int)
- func (self Instance) SetOrientation(value gdclass.TextServerOrientation)
- func (self Instance) SetPreserveControl(value bool)
- func (self Instance) SetPreserveInvalid(value bool)
- func (self Instance) SetTextOverrunBehavior(value gdclass.TextServerOverrunBehavior)
- func (self Instance) SetWidth(value Float.X)
- func (self Instance) TabAlign(tab_stops []float32)
- func (self Instance) TextOverrunBehavior() gdclass.TextServerOverrunBehavior
- func (self *Instance) UnsafePointer() unsafe.Pointer
- 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 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 InlineAlignment ¶
type InlineAlignment int
const ( /*Aligns the top of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant.*/ InlineAlignmentTopTo InlineAlignment = 0 /*Aligns the center of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant.*/ InlineAlignmentCenterTo InlineAlignment = 1 /*Aligns the baseline (user defined) of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant.*/ InlineAlignmentBaselineTo InlineAlignment = 3 /*Aligns the bottom of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant.*/ InlineAlignmentBottomTo InlineAlignment = 2 /*Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the top of the text.*/ InlineAlignmentToTop InlineAlignment = 0 /*Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the center of the text.*/ InlineAlignmentToCenter InlineAlignment = 4 /*Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the baseline of the text.*/ InlineAlignmentToBaseline InlineAlignment = 8 /*Aligns inline object (e.g. image, table) to the bottom of the text.*/ InlineAlignmentToBottom InlineAlignment = 12 /*Aligns top of the inline object (e.g. image, table) to the top of the text. Equivalent to [code]INLINE_ALIGNMENT_TOP_TO | INLINE_ALIGNMENT_TO_TOP[/code].*/ InlineAlignmentTop InlineAlignment = 0 /*Aligns center of the inline object (e.g. image, table) to the center of the text. Equivalent to [code]INLINE_ALIGNMENT_CENTER_TO | INLINE_ALIGNMENT_TO_CENTER[/code].*/ InlineAlignmentCenter InlineAlignment = 5 /*Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equivalent to [code]INLINE_ALIGNMENT_BOTTOM_TO | INLINE_ALIGNMENT_TO_BOTTOM[/code].*/ InlineAlignmentBottom InlineAlignment = 14 /*A bit mask for [code]INLINE_ALIGNMENT_*_TO[/code] alignment constants.*/ InlineAlignmentImageMask InlineAlignment = 3 /*A bit mask for [code]INLINE_ALIGNMENT_TO_*[/code] alignment constants.*/ InlineAlignmentTextMask InlineAlignment = 12 )
type Instance ¶
type Instance [1]gdclass.TextParagraph
Abstraction over [TextServer] for handling a single paragraph of text.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddObject ¶
Adds inline object to the text buffer, [param key] must be unique. In the text, object is represented as [param length] object replacement characters.
func (Instance) Alignment ¶
func (self Instance) Alignment() HorizontalAlignment
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsTextParagraph ¶
func (Instance) BreakFlags ¶
func (self Instance) BreakFlags() gdclass.TextServerLineBreakFlag
func (Instance) Clear ¶
func (self Instance) Clear()
Clears text paragraph (removes text and inline objects).
func (Instance) CustomPunctuation ¶
func (Instance) Direction ¶
func (self Instance) Direction() gdclass.TextServerDirection
func (Instance) Draw ¶
Draw all lines of the text and drop cap into a canvas item at a given position, with [param color]. [param pos] specifies the top left corner of the bounding box.
func (Instance) DrawDropcap ¶
Draw drop cap into a canvas item at a given position, with [param color]. [param pos] specifies the top left corner of the bounding box.
func (Instance) DrawDropcapOutline ¶
Draw drop cap outline into a canvas item at a given position, with [param color]. [param pos] specifies the top left corner of the bounding box.
func (Instance) DrawLine ¶
Draw single line of text into a canvas item at a given position, with [param color]. [param pos] specifies the top left corner of the bounding box.
func (Instance) DrawLineOutline ¶
Draw outline of the single line of text into a canvas item at a given position, with [param color]. [param pos] specifies the top left corner of the bounding box.
func (Instance) DrawOutline ¶
Draw outlines of all lines of the text and drop cap into a canvas item at a given position, with [param color]. [param pos] specifies the top left corner of the bounding box.
func (Instance) EllipsisChar ¶
func (Instance) GetDropcapLines ¶
Returns number of lines used by dropcap.
func (Instance) GetDropcapRid ¶
func (self Instance) GetDropcapRid() RID.TextBuffer
Returns drop cap text buffer RID.
func (Instance) GetDropcapSize ¶
Returns drop cap bounding box size.
func (Instance) GetLineAscent ¶
Returns the text line ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
func (Instance) GetLineCount ¶
Returns number of lines in the paragraph.
func (Instance) GetLineDescent ¶
Returns the text line descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
func (Instance) GetLineObjectRect ¶
func (self Instance) GetLineObjectRect(line int, key any) Rect2.PositionSize
Returns bounding rectangle of the inline object.
func (Instance) GetLineObjects ¶
Returns array of inline objects in the line.
func (Instance) GetLineRange ¶
Returns character range of the line.
func (Instance) GetLineRid ¶
func (self Instance) GetLineRid(line int) RID.TextBuffer
Returns TextServer line buffer RID.
func (Instance) GetLineSize ¶
Returns size of the bounding box of the line of text. Returned size is rounded up.
func (Instance) GetLineUnderlinePosition ¶
Returns pixel offset of the underline below the baseline.
func (Instance) GetLineUnderlineThickness ¶
Returns thickness of the underline.
func (Instance) GetLineWidth ¶
Returns width (for horizontal layout) or height (for vertical) of the line of text.
func (Instance) GetNonWrappedSize ¶
Returns the size of the bounding box of the paragraph, without line breaks.
func (Instance) GetRid ¶
func (self Instance) GetRid() RID.TextBuffer
Returns TextServer full string buffer RID.
func (Instance) HitTest ¶
Returns caret character offset at the specified coordinates. This function always returns a valid position.
func (Instance) JustificationFlags ¶
func (self Instance) JustificationFlags() gdclass.TextServerJustificationFlag
func (Instance) MaxLinesVisible ¶
func (Instance) Orientation ¶
func (self Instance) Orientation() gdclass.TextServerOrientation
func (Instance) PreserveControl ¶
func (Instance) PreserveInvalid ¶
func (Instance) ResizeObject ¶
Sets new size and alignment of embedded object.
func (Instance) SetAlignment ¶
func (self Instance) SetAlignment(value HorizontalAlignment)
func (Instance) SetBidiOverride ¶
Overrides BiDi for the structured text. Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
func (Instance) SetBreakFlags ¶
func (self Instance) SetBreakFlags(value gdclass.TextServerLineBreakFlag)
func (Instance) SetCustomPunctuation ¶
func (Instance) SetDirection ¶
func (self Instance) SetDirection(value gdclass.TextServerDirection)
func (Instance) SetDropcap ¶
Sets drop cap, overrides previously set drop cap. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text.
func (Instance) SetEllipsisChar ¶
func (Instance) SetJustificationFlags ¶
func (self Instance) SetJustificationFlags(value gdclass.TextServerJustificationFlag)
func (Instance) SetMaxLinesVisible ¶
func (Instance) SetOrientation ¶
func (self Instance) SetOrientation(value gdclass.TextServerOrientation)
func (Instance) SetPreserveControl ¶
func (Instance) SetPreserveInvalid ¶
func (Instance) SetTextOverrunBehavior ¶
func (self Instance) SetTextOverrunBehavior(value gdclass.TextServerOverrunBehavior)
func (Instance) TextOverrunBehavior ¶
func (self Instance) TextOverrunBehavior() gdclass.TextServerOverrunBehavior