Closed
Description
Tested versions
v4.3.stable.official [77dcf97]
System information
Godot v4.3.stable.mono - Windows 10.0.17763 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4060 Ti (NVIDIA; 32.0.15.6109) - AMD Ryzen 9 5900X 12-Core Processor (24 Threads)
Issue description
The text will overflow when assigning the text
property in the script.
Steps to reproduce
- Create a new project
- Create an empty
Control
scene, save it to a file, and mark it the main scene - Attach the MRP script to the root node
- Run the scene
Minimal reproduction project (MRP)
extends Control
func _ready():
var btn := Button.new();
btn.text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
btn.autowrap_mode = TextServer.AUTOWRAP_WORD;
var vbox = VBoxContainer.new();
vbox.add_child(btn);
vbox.set_anchors_preset(Control.PRESET_FULL_RECT);
vbox.alignment = BoxContainer.ALIGNMENT_CENTER;
add_child(vbox);