How to align UI at the center when window (keep height) expand

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Văn Viết Hiếu Anh

Hello! I’m working on my platformer and now I have some trouble with the dialogbox when window expand.
my screen setting
Here my Strech setting, I want to keep the height so that I can show UI on right and left hand side. So I set the aspect to “keep_height”. Set the Dialog Box to align as top center anchor(0,0,1,0) and set it margin top 32px.
My strech setting

Everything look good to me (like image bellow)
This LGTM

Until I scale the window in horizontal :> It’s break the rule
enter image description here

What should I do? I just want the dialogue box be align at the center no matter how big the width of screen is. Thanks!

Btw, Is it any way to set Anchor Mode of the default camera (Scene without Camera2D node)

:bust_in_silhouette: Reply From: barbaros

are u using containers ?

I only use one VboxContainer for Name and Text of Dialog, that’s it. Do you mean that container can help ?

Văn Viết Hiếu Anh | 2021-07-28 20:58

:bust_in_silhouette: Reply From: Văn Viết Hiếu Anh

Heck. I’m stupid. All I need to do is move all Control Node Stuff in a Canvas Layer. I just leave this comment here for those who may need.