Hello Guest

Author Topic: Changing Fonts  (Read 5507 times)

esaevian

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 1
    • View Profile
Changing Fonts
« on: April 04, 2012, 06:47:33 pm »
Hello, I am having som difficulty changing fonts. Here's what I have:

Code: [Select]
public tk2dFont newFont;
public tk2dTextMesh textMesh;

public function ChangeFont() {
    textMesh.font = newFont.data;
   textMesh.Commit();
}

It looks like it is actually switching the Font Data correctly. I check the inspector and the drop down for the font on that specific textmesh is correct.

The problem is the material doesn't update. So it's using the old font's material, with the new FontData...and it just show up on the Game Screen as gobbeldygook.

Is there a way within 2D Toolkit to update the material, or will i have to change the material myself?

Thanks!

-Esa

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Changing Fonts
« Reply #1 on: April 04, 2012, 08:58:41 pm »
This is a bug. I'll get it fixed for the next version. If you need a quicker fix, let me know and I'll post the fix as soon as I have it ready.

rhart

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Changing Fonts
« Reply #2 on: April 27, 2012, 05:01:26 pm »
Yes, I am working on a production project that will need to change fonts too and am finding the same issue. Would be fantastic to see this working in the next release.

Thank you   :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Changing Fonts
« Reply #3 on: April 27, 2012, 06:52:53 pm »
Its already been done and will be in the next release :)