godot icon indicating copy to clipboard operation
godot copied to clipboard

Godot 3 to 4 Conversion: scene Label align and valign values get discarded

Open Reneator opened this issue 2 years ago • 1 comments

Godot version

v4.0.stable.official [92bee43ad]

System information

Windows 10

Issue description

Label align and valign just get discarded, having to replace them with the new values. in the .tscn files it would be a conversion of:

valign = 1 = vertical_alignement = 1 align = 1 = horizontal_alignment = 1

But to get it to actually work the Label inside the tscn would also need to get the layout_mode = 2 attribute to have set, else it will discard the replaced values

(Tested by changes via external text-editor on the tscn file directly before opening it.)

Steps to reproduce

migration from 3.X to 4

Minimal reproduction project

n/a

Reneator avatar Mar 06 '23 13:03 Reneator

Layout mode has nothing to do with text alignment inside of the label. You do have a typo in your code sample though.

YuriSizov avatar Mar 06 '23 15:03 YuriSizov

Fixed the typo, that happens if you do it free hand.

Its just a behaviour that i noticed, that if i just replace the align and valign with the new property names, those settings get discarded, unless i also add the layout_mode = 2 in the .tscn

Reneator avatar Mar 06 '23 19:03 Reneator

That's not possible, something else must be happening at the same time. Please provide MRP that demonstrates the issue.

YuriSizov avatar Mar 06 '23 19:03 YuriSizov

Added an MRP created in godot v3.5.1.stable.official [6fed1ffa3] with 3 .tscn files, 3 times just a label with centered text, the first one with no manual changes to the .tscn, the second with the new names for the align and valign and the third with the layout_mode = 2 also added.

(The third one is not relevant for the core issue of this topic, but just wanted to leave it in for test-purposes)

The first scene will remove the alignment the second scene will keep the alignment due to proper renaming, done manually.

Reneator avatar Mar 06 '23 21:03 Reneator

Also had this issue, had to reset all labels by hand

naturally-intelligent avatar Mar 07 '23 02:03 naturally-intelligent

Tried this on my machine using the MRP and can confirm that the issue exists. Will try to fix it.

Quimisagi avatar Oct 05 '23 19:10 Quimisagi