1
Support / number of lines in tk2dTextMesh
« on: February 18, 2013, 04:57:39 pm »Code: [Select]
// calculation width and height tooltip window
Vector2 dimension = textMesh.GetMeshDimensionsForString(text);
int countLine = Mathf.CeilToInt(dimension.x / textMesh.wordWrapWidth);
Debug.Log("countLine = " + countLine + ", dimension.x = " + dimension.x);
float heightY = Mathf.Abs(dimension.y) * countLine;
tk2dSlicedSprite slicedSprite = GetComponent<tk2dSlicedSprite>();
slicedSprite.dimensions = new Vector2(slicedSprite.dimensions.x, heightY);
why the number of lines does not correspond to the actual count?
Where did I wrong?