Hello Guest

Author Topic: Mesh Filter Doesn't Get Set  (Read 4492 times)

paulg

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Mesh Filter Doesn't Get Set
« on: June 29, 2013, 01:29:17 am »
Greetings,

I'm working on adding tk2dtextmeshes to dynamically created gameobjects in code. I've set up the material, text, pixelperfect, and  have a Commit() call but the gameobjects still do not show up. When running the game, I can select the new gameobjects and I see that everything looks correct except for the mesh filter (it reads "none"). From what I have read the filter is dynamically created, however I can't seem to be able to generate it using any function calls to mesh's tied to the gamobject or changing the textmeshes scale. If I select any of the scale altering buttons for the textmesh in the UI (Like 1:1, BakeScale, etc) the mesh filter will generate and the object will be displayed correctly. Obviously, clicking in the UI to get text to show up isn't optimal... Any help would be greatly appreciated.

Sorry if this is a basic question, but I haven't been able to find a useful resource in quite a while.

Thanks,
Paul

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Mesh Filter Doesn't Get Set
« Reply #1 on: June 29, 2013, 06:18:13 pm »
1. Why did you set the material?
2. Did you set the font? This is important - If you don't have a font, calling Commit will not actually do anything...


(Clicking the UI will fix up missing fonts and stuff, that'll explain why it works when you do that).

paulg

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Mesh Filter Doesn't Get Set
« Reply #2 on: June 29, 2013, 07:12:19 pm »
In the UI it says I did set the font, but I actually found out that it wasn't set. Looking into why the font isn't getting through the resources.load call currently.

paulg

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Mesh Filter Doesn't Get Set
« Reply #3 on: June 29, 2013, 08:02:20 pm »
Got it working. Thanks so much. For some reason I got it into my head that setting the material set the font. Just had to load the fontdata and it works.

Thanks, and btw great work on this tool. Makes things so much easier!