YarnActionMarkupHandler
interface for handling markup actions during typewriter presentation. runs at display-time to react to text being revealed (unlike replacement marker processors, which run at parse-time and modify text). subclass and override the methods needed for the desired effect.
class_name YarnActionMarkupHandler
extends RefCountedInherits from RefCounted
#Nested Types
- ContinueButtonHandler classcontrols a "continue" button during line presentation. shows the button when a line starts, hides on dismiss, requests next line on click.
- ShakeActionHandler classshakes the text container during [shake] markup.
#Methods
#get_attributes_at_index(int, Array)
returns all attributes covering a specific character index.
static func get_attributes_at_index(index: int, attributes: Array) -> Array[YarnMarkupAttribute]Parameters
indexintattributesArray
Returns Array[YarnMarkupAttribute]
#is_index_in_attribute(int, YarnMarkupAttribute)
static func is_index_in_attribute(index: int, attr: YarnMarkupAttribute) -> boolParameters
indexint
Returns bool
#on_character_will_appear(int, Variant, Variant)
called for each character during typewriter reveal. return a Signal to pause the typewriter, or empty Signal() to continue.
func on_character_will_appear(character_index: int, line: Variant, cancellation_token: Variant = null) -> SignalParameters
character_indexintlineVariantcancellation_tokenVariant
Returns Signal
#on_line_display_begin(Variant, Control)
called immediately before the first character is presented.
func on_line_display_begin(line: Variant, text_control: Control = null) -> voidParameters
lineVarianttext_controlControl
#on_line_display_complete()
called after all characters have been presented.
func on_line_display_complete() -> void#on_line_will_dismiss()
called right before the line dismisses (may be after typewriter completes).
func on_line_will_dismiss() -> void#on_prepare_for_line(Variant, Control)
called before any text is visible. set up state here.
func on_prepare_for_line(line: Variant, text_control: Control = null) -> voidParameters
lineVarianttext_controlControl
Generated from Yarn Spinner for Godot GDScript 3.3.