How do I get the height of a text box?

I want to stack a few text boxes above each other with a permanent distance between them. Their content is dynamically created so the height of the text boxes will vary depending on how many rows they contain. I tried to use the text height expression but it doesn’t seem to work. I wrote something like this:
The Y position of text2 = text1.Y()+text1.Height()+20

That doesn’t seem to work when text1 has a line break (I have activated text wrap).

How can I get the height of the text box?



It should work. What’s happening?

Check the order of your events. Make sure you’re moving text2 after the text is changed in text1 or it will use the old height.

Check the spelling of everything (capitalization matters) I do that a lot.

Are you using any behaviors like anchor? They might interfere.

As explained in the wrapping action:
That’s probably what is giving you trouble.

IDK. I tested it with wrap on and off and it seemed to work. I did have trouble in testing. I wanted to try to reposition the text with a keypress or by dragging/dropping the top object. It stopped working with the keyboard when I added the drop because even with the OR it checks the drag condition and unpicks the text object because it’s not being dragged. Weird. I assumed if the first condition was true then it wouldn’t check the other one. Adding pick all instances at the end fixed it.

What I’m saying is make sure a condition or a for event isn’t changing the pick status.

Thanks for all help,
I made the following and it works, even though it makes no sense. I have set a line break (wrapping) at 900. I guess that it only works if there are one or two lines but not three. Anyways, I won’t have three lines :stuck_out_tongue: