Skip to content

Commit

Permalink
tail is workinggit status
Browse files Browse the repository at this point in the history
  • Loading branch information
IntangibleMatter committed Jun 12, 2023
1 parent a0ac770 commit ff34e52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions addons/IntCut/display/dialoguebubble/dialogue_bubble.gd
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,12 @@ func update_tail() -> void:

# Make it so they rotate to face the last point. Bit of trig to do, I guess.

var rotate_by := atan2(temp_points[0].x, -temp_points[0].y)
var tail_width = maximum_tail_width if maximum_tail_width * 2 < bubble_rect.size.x else bubble_rect.size.x / 2

temp_points.append(Vector2(-tail_width, 0).rotated(rotate_by))
temp_points.append(Vector2(tail_width, 0).rotated(rotate_by))

temp_points[1] += bubble_rect.get_center()
temp_points[2] += bubble_rect.get_center()
var dir = rect_center.direction_to(temp_points[0])
temp_points.append(dir.orthogonal()*tail_width+rect_center)
temp_points.append(dir.orthogonal()*-tail_width+rect_center)

# prints(get_viewport().get_mouse_position(), temp_points)
tail_points = temp_points

prints("tp", temp_points)
# prints("tp", temp_points)
2 changes: 1 addition & 1 deletion testscenes/dialoguebubbletest.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ texture = ExtResource("3_c4pn0")
[node name="CanvasLayer" type="CanvasLayer" parent="."]

[node name="DialogueBubble" parent="CanvasLayer" node_paths=PackedStringArray("actor") instance=ExtResource("1_4ggul")]
text = PackedStringArray("[wave amp=30]oooooooooooops")
text = PackedStringArray("[shake level=30]Thank you!")
actor = NodePath("../../TestActor")
bubble_oscilate_speed = 500.0

0 comments on commit ff34e52

Please sign in to comment.