Hi,
I would like to implement a very basic thing, but Google didn’t help me much. Printing some text in separate boxes and being able to slide them. See attached picture.
I think this can be done in two ways:
Using transforms as text boxes. This should be quite easy and beautiful. But I don’t know how to attach text to transforms (cubes)
Using GUI elements. This would be nice too, but I don’t know how to change the position of GUI elements programmatically.
I’m ok with both approaches.
Which way would you prefer and how can I manage this? Any help would be appreciated. Thanks in advance.
UnityGUI is great on anything except in-game mobile.
If doeing mobile, people say that using 3D elements is better because of the performance. However, if using this in menu screens (not in game) the performance of UnityGUI on mobile is quite well. In any case, I suggest using a framework.
Use GUIText and GUITexture objects. They can be parented to an empty game object, and moved as a group by moving that empty object (keeping in mind that GUIElements use viewport space and not world space).
Put the elements in a BeginArea/EndArea block, and use a variable for the y position of the Rect for that block, and change that variable over time (such as in a coroutine).