class

PointClickEngine::UI::DialogManager

Inherits Reference < Object

Constructors

Instance methods

add_character_portrait(character_name : String, texture_path : String) : DialogPortrait

Add a character portrait

Source
add_dialog_tree(dialog_tree : Characters::Dialogue::DialogTree)

Add a dialog tree

Source
cleanup

Cleanup resources

Source
close_current_dialog
Source
current_dialog
Source
current_dialog=(current_dialog : Dialog | Nil)
Source
dialog_consumed_input?
Source
dialog_queue
Source
dialog_queue=(dialog_queue : Array(Dialog))
Source
dialog_trees
Source
dialog_trees=(dialog_trees : Hash(String, Characters::Dialogue::DialogTree))
Source
draw
Source
enable_floating
Source
enable_floating=(enable_floating : Bool)
Source
enable_portraits
Source
enable_portraits=(enable_portraits : Bool)
Source
floating_manager
Source
floating_manager=(floating_manager : FloatingDialogManager)
Source
frame_context
Source
frame_context=(frame_context : PointClickEngine::Graphics::FrameContext | Nil)
Source
get_dialog_tree(name : String) : Characters::Dialogue::DialogTree | Nil

Get a dialog tree by name

Source
input_dialog
Source
input_dialog=(input_dialog : InputDialog | Nil)
Source
is_dialog_active?
Source
message_display_time
Source
message_display_time=(message_display_time : Float32)
Source
portrait_manager
Source
portrait_manager=(portrait_manager : PortraitManager)
Source
set_portrait_position(position : PortraitPosition)

Configure portrait positioning

Source
set_speaker_expression(expression : PortraitExpression)

Set expression for current speaker

Source
show_character_dialog(character_name : String, text : String, character_pos : RL::Vector2, style : DialogStyle = DialogStyle::Bubble)

Show floating dialog for character (convenience method)

Source
show_choice(prompt : String, options : Array(String), callback : Proc(Int32, Nil))
Source
show_dialog(character_name : String, text : String, choices : Array(DialogChoice) | Nil = nil, expression : PortraitExpression = PortraitExpression::Neutral)
Source
show_dialog_choices(prompt : String, choices : Array(String), &callback : Int32 -> )

Show dialog choices at bottom of screen

Displays a dialog box with multiple choices at the bottom of the screen. This is useful for branching conversations and interactive dialogs.

prompt - The question or prompt to display choices - Array of choice texts callback - Proc called with the index of the selected choice position - Optional position override (defaults to bottom of screen) size - Optional size override (defaults to wide dialog box)

dialog_manager.show_dialog_choices(
  "What would you like to ask?",
  ["Tell me about the crystal", "Who else is here?", "Goodbye"],
  ->(choice : Int32) {
    case choice
    when 0 then show_crystal_info
    when 1 then show_character_list
    when 2 then end_conversation
    end
  }
)
Source
show_dialog_choices_at(prompt : String, choices : Array(String), position : RL::Vector2, size : RL::Vector2, &callback : Int32 -> )

Show dialog choices with custom positioning

Source
show_floating_dialog(character_name : String, text : String, character_pos : RL::Vector2, duration : Float32 | Nil = nil, style : DialogStyle = DialogStyle::Bubble, color : RL::Color | Nil = nil)

Show floating dialog above character position

Source
show_floating_text(text : String, position : RL::Vector2, color : RL::Color = RL::WHITE, duration : Float32 = 3.0)

Show floating text at a specific position

Source
show_input_dialog(prompt : String, max_length : Int32 = 32, &callback : String -> )

Show an input dialog for text entry

Displays a modal dialog with a text input field. Used for safe combinations, passwords, character names, etc.

prompt - The prompt text to display above the input field max_length - Maximum characters allowed (default 32) callback - Proc called with the entered text (empty string if cancelled)

dialog_manager.show_input_dialog("Enter the safe combination:") do |text|
  if text == "1234"
    open_safe
  else
    show_message("Wrong combination!")
  end
end
Source
show_input_dialog_with_default(prompt : String, default_text : String, max_length : Int32 = 32, &callback : String -> )

Show input dialog with a default value

Source
show_message(text : String, duration : Float32 = 3.0_f32)
Source
start_dialog_tree(tree_name : String, starting_node : String = "greeting")

Start a conversation with a dialog tree

Source
toggle_portraits(enabled : Bool)

Toggle portrait system

Source
update(dt : Float32)
Source