2D Toolkit Forum

2D Toolkit => Support => Topic started by: mochatony on March 18, 2013, 12:31:44 pm

Title: tk2dTextMesh text misalignment after commit
Post by: mochatony 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

Title: Re: tk2dTextMesh text misalignment after commit
Post by: m4ko on March 18, 2013, 01:59:58 pm
Does the transfom.position.x/y of the TextMesh GameObject change?
Title: Re: tk2dTextMesh text misalignment after commit
Post by: mochatony 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.
Title: Re: tk2dTextMesh text misalignment after commit
Post by: unikronsoftware on March 18, 2013, 02:25:09 pm
where is the pivot point on both the meshes?
Title: Re: tk2dTextMesh text misalignment after commit
Post by: mochatony on March 18, 2013, 06:27:47 pm
Sorry, I am fairly new to unity. How do I check the pivot point?
Title: Re: tk2dTextMesh text misalignment after commit
Post by: unikronsoftware 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".
Title: Re: tk2dTextMesh text misalignment after commit
Post by: mochatony 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.
Title: Re: tk2dTextMesh text misalignment after commit
Post by: unikronsoftware 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.