Hello Guest

Author Topic: tk2dtextmesh gizmo off visually within Unity3d  (Read 9763 times)

OnlineCop

  • Newbie
  • *
  • Posts: 11
    • View Profile
tk2dtextmesh gizmo off visually within Unity3d
« on: February 20, 2012, 07:24:16 pm »
When I add a tk2dtextmesh to my scene, the gizmo (the thing that lets you move/rescale/rotate your objects) appears in different locations of Unity based upon the type of whitespace found in the text.

I currently have a small timer animation which should show the text "TIME LEFT".




When the words are separated with a space, the gizmo appears below the text (sometimes far below), and what appears to be centered to the average width of each of the space-separated words.

If I replace the space between the words with an underscore, the gizmo is centered (both horizontally and vertically) over the text as I would expect.




This only appears to be a visual (editor) anomaly, but I was wondering what I could do (edit one of the .cs files?) to correct this so I can use spaces between my words without it moving the gizmo around (screenshots and text settings attached, if it helps explain).
« Last Edit: February 20, 2012, 07:26:17 pm by OnlineCop »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dtextmesh gizmo off visually within Unity3d
« Reply #1 on: February 20, 2012, 09:43:32 pm »
What is the gizmo mode set to? Is it on Pivot or center? This could also be because of your font - could you send me a the font to look at?

OnlineCop

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: tk2dtextmesh gizmo off visually within Unity3d
« Reply #2 on: February 20, 2012, 10:22:13 pm »
The gizmo mode is set to center. Pivot (whether using a space or an underscore) appears to place the gizmo at the bottom-left corner of the mesh, and doesn't appear to move based on the whitespace between the words.

For the font, do I provide the .fnt file, the .prefab, or the .mat?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dtextmesh gizmo off visually within Unity3d
« Reply #3 on: February 20, 2012, 10:54:31 pm »
fnt and texture will do, thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dtextmesh gizmo off visually within Unity3d
« Reply #4 on: February 20, 2012, 10:54:59 pm »
could you email that to support at unikronsoftware dot com, please.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dtextmesh gizmo off visually within Unity3d
« Reply #5 on: February 20, 2012, 11:18:22 pm »
Solved:

The fnt file had a line for the space character:
char id=32 x=236 y=86 width=0 height=0 xoffset=-113 yoffset=147 xadvance=7 page=0 chnl=0 letter="space"

It was offsetting the origin of the character by that (-113,147) pixel units when there was no reason to do so. I've added some code to handle this case in the future - in any case, that error there can be fixed by manually editing the text file.

OnlineCop

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: tk2dtextmesh gizmo off visually within Unity3d
« Reply #6 on: February 21, 2012, 12:46:38 am »
As a follow-up: The fonts were generated using GlyphDesigner (http://glyphdesigner.71squared.com/) version 1.5.2 (953). I'll let them know what's happened when importing it into Unity (I might as well just send them the URL to this forum discussion).

But I wanted to post this name in here in case any future searches turn up with the same kind of oddity.