Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - narenski

Pages: [1]
1
Support / Re: TextMesh character position and size
« on: April 16, 2014, 06:08:23 pm »
I find how to get a size. is by calling mesh.renderer.bounds.size;
this is the code. the characters are not a the good position: I'm using a tk2dCamera
I don't know why but when id devide the bounds.size / 10 it's seem working a little. But i have not the good x position.
Can anyone help me::

    private void DoText()
    {
        float position = 0;
        foreach (var c in "New TextMesh")
        {
            var go = (UnityEngine.GameObject)UnityEngine.GameObject.Instantiate(UnityEngine.Resources.Load("Prefabs/TextMesh"));
            var mesh = go.GetComponent<tk2dTextMesh>();
            mesh.text = c.ToString();
             var bounds = mesh.renderer.bounds;
            go.transform.position = new Vector3(position, go.transform.position.y, go.transform.position.z);

            position += bounds.size.x / 10 ;
        }
    }

2
Support / TextMesh character position and size
« on: April 16, 2014, 02:42:08 pm »
Hi
I'm looking for a way get Textmesh character height and width printed at screen?
Is it possible?
 thx

Pages: [1]