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 - Fohlin

Pages: [1]
1
Support / Re: tk2dTextMesh set font with script
« on: October 16, 2013, 10:57:54 am »
Thank you, it was the file format that was strange. I couldn't figure out how to change the encoding from within Monodevelop-Unity, and saw lots of people recommending Notepad++(win) or TextWrangler(mac) for this. So when I saved the .cs file as utf-16 from TextWrangler it worked. A bit strange that it didn't work in utf-8 format.

But it's working now atleast :)

EDIT: Saved as UTF-8, with BOM from Textwrangler also worked

2
Support / Re: tk2dTextMesh set font with script
« on: October 16, 2013, 10:29:35 am »
Hi again. I have a kind of related problem now with this textmesh and using characters like Å Ä Ö in it. When I type the characters into the textmesh from the Inspector in Unity they show up correctly in the textmesh, but not when using script: textmesh.text = "åäö"; textmesh.Commit();
How can I send this string to the textmesh the right way?. Thanks!

3
Support / Re: tk2dTextMesh set font with script
« on: July 25, 2013, 01:11:51 pm »
Yes I just solved it!
I put the custom FontData file that was created (automatically?) in Assets/Fonts/Resources so I could retrieve it, like this:
GameObject fontData = Resources.Load("TrollFontData") as GameObject;
textmesh.font = fontData.GetComponent<tk2dFontData>();

Thank you for the fast reply!

4
Support / tk2dTextMesh set font with script
« on: July 25, 2013, 12:47:32 pm »
I'm creating a new gameobject and attaching a tk2dTextMesh component to it, and I want to also set the font it should be using. I see that there is a font variabel I could set, but I couldn't figure out how to use it properly. I have created a custom font and want to use that. Can I get my font through the tk2dFontData in some way? I know there is a way to create a prefab and use that one, but I rather not : ) Thanks

Pages: [1]