Hello Guest

Author Topic: TextMesh Moving Position After Commit  (Read 3009 times)

ephro

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
TextMesh Moving Position After Commit
« on: August 15, 2013, 12:42:43 am »
I'm pretty new to Unity and 2d Toolkit. I had a problem where when I had a textmesh positioned where I wanted it on screen it would stay there. After I would change the text and do a Commit it would move down in the scene. I finally figured out that I had to click the "Fit" button in the inspector and it would move to where it would be post-Commit, and I could then position it properly in the editor. Is this normal, or am I just doing something wrong?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: TextMesh Moving Position After Commit
« Reply #1 on: August 15, 2013, 01:58:55 pm »
Did you press enter in the textbox?

Eg. If you had the anchor set to bottom left, and then pressed enter in the textbox, you'd be inserting one line of nothing into your textmesh, pushing it above origin. Then if you replaced the text with something that didn't contain a newline the text would appear to move down. Make sure you've got the correct anchor set as well.

You should have the correct number of characters in the textmesh - to avoid reallocations, the mesh will not resize its buffers internally if you try to insert more characters than has been allocated.