Skip to content

Commit

Permalink
Fix: Make float dialog follow character (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
StraToN authored Nov 11, 2021
1 parent 59c03dd commit b908a2a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions addons/escoria-dialog-simple/types/floating.gd
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ func _ready():
$Tween.connect("tween_completed", self, "_on_dialog_line_typed")


func _process(delta):
# Position the RichTextLabel on the character's dialog position, if any.
rect_position = _current_character.get_node("dialog_position") \
.get_global_transform_with_canvas().origin
rect_position.x -= rect_size.x / 2


# Make a character say something
#
# #### Parameters
Expand All @@ -57,9 +64,11 @@ func say(character: String, line: String) :

# Position the RichTextLabel on the character's dialog position, if any.
_current_character = escoria.object_manager.get_object(character).node
rect_position = _current_character.get_node("dialog_position").get_global_transform_with_canvas().origin
rect_position = _current_character.get_node("dialog_position") \
.get_global_transform_with_canvas().origin
rect_position.x -= rect_size.x / 2

# Start talking animation
_current_character.start_talking()

# Set text color to color set in the actor
Expand All @@ -76,9 +85,10 @@ func say(character: String, line: String) :
0.0, 1.0, time_show_full_text,
Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
tween.start()
set_process(true)


# Called by the dialog player when the
# Called by the dialog player when user wants to finish dialog fast.
func speedup():
if not _is_speeding_up:
_is_speeding_up = true
Expand Down

0 comments on commit b908a2a

Please sign in to comment.