Hello Guest

Author Topic: tk2dTextMesh text misalignment after commit  (Read 6055 times)

mochatony

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
tk2dTextMesh text misalignment after commit
« on: March 18, 2013, 12:31:44 pm »
I tried to update text of tk2dTextMesh with following code:

      lifeLabel.text = "2";
      lifeLabel.Commit();

But, found out the text vertical alignment drop to the next line. I attached the images and configuration.

First image is the original display, second is after commit and third is the configuration. How do I resolved this?

Thank you


m4ko

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 75
    • View Profile
Re: tk2dTextMesh text misalignment after commit
« Reply #1 on: March 18, 2013, 01:59:58 pm »
Does the transfom.position.x/y of the TextMesh GameObject change?

mochatony

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: tk2dTextMesh text misalignment after commit
« Reply #2 on: March 18, 2013, 02:16:41 pm »
The transform position remains the same.

The life and 3 is separate tk2dTextMesh, which I only update to the "3" tk2dTextMesh.

Thanks for reply.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dTextMesh text misalignment after commit
« Reply #3 on: March 18, 2013, 02:25:09 pm »
where is the pivot point on both the meshes?

mochatony

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: tk2dTextMesh text misalignment after commit
« Reply #4 on: March 18, 2013, 06:27:47 pm »
Sorry, I am fairly new to unity. How do I check the pivot point?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dTextMesh text misalignment after commit
« Reply #5 on: March 18, 2013, 10:49:54 pm »
Select the objects one at a time, make sure you are in move mode and the two boxes next to it say "Pivot" and "Local".

mochatony

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: tk2dTextMesh text misalignment after commit
« Reply #6 on: March 19, 2013, 01:48:54 pm »
Thanks for reply. By default, it is center and global. I tried to switch to pivot and local, but it still dropping to the next line.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dTextMesh text misalignment after commit
« Reply #7 on: March 19, 2013, 02:02:31 pm »
If your project is small, can you zip it up and email to support at unikronsoftware.com? Much easier than going through all the possibilities here. I only need the assets directly affecting this, i.e. the scene and the font and your script that changes it.