PopupDialog not opening in correct spot.

LethargicDeveloperLethargicDeveloper Posts: 4Member
edited June 4 in GUI

Godot v3.2.1

CanvasLayer
|> PopupDialog
|>|> AnimationPlayer

  • The CanvasLayer has a script that calls $PopupDialog.popup()
  • The PopupDialog has a script that subscribes to it's own _about_to_show() and plays an animation:
func _on_PopupDialog_about_to_show():
        $AnimationPlayer.play("Grow")
  • The AnimationPlayer has an animation called "Grow" the Animation is tied to the Popup's scale property and goes from 0,0 to 1,1
  • The pivot offset (the place that it's growing around) is set to the PopupDialog's center.
  • The result should be that when the popup dialog shows it should grow from its center.

When playing the animation from the IDE it works fine.

1) If the animation is set to its last frame in the IDE (scale 1,1) then when I run the app it grows correctly, but there is a visible flash since it starts at scale 1,1 then does the grow animation from 0,0 to 1,1

2) If the animation is set to its first frame in the IDE (scale 0,0) then when I run the app it grows correctly but not from the correct position. For example if the upper left corner of the PopupDialog is 0,0 and the center is 5,5 then when I run the app its upper left corner is around 5,5 and its center is around 10,10. However, when I print the rect_pivot_offset and rect_position I get the same values whether I've run with option 1 or option 2

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file