Hi everyone,
I have an array of words, for example: ["Harmony", "Venture", "Illuminate", "Catalyst", "Whisper", "Resolve", "Ember", "Ascent", "Heaven"].
I want to display these words inside a container (e.g., a Sprite). Each word from the array will be its own Text object.
The desired layout is as follows (inspired by how answers are sometimes displayed in word search games, see image below for an example):
Row Formation:
The Text objects (words) should be arranged into rows.
Each row should accommodate as many words as possible from the array without the combined width of the Text objects in that row (plus a defined horizontal spacing between them) exceeding the container's width.
When adding the next word would exceed the container's width, that word should start a new row.
If a single word (a single Text object) is wider than the container, it should occupy its own row.
Horizontal Centering of Rows: Each complete row of Text objects should be horizontally centered within the container.
Vertical Centering of the Entire Block: The entire resulting block of rows (all the Text objects collectively) should be vertically centered within the container.
https://drive.google.com/file/d/1b6TN_BRHcA2dXvGLn0NE_EgNGF5pgf-T/view?usp=sharing