2D Toolkit Forum

2D Toolkit => Support => Topic started by: timchiang on January 03, 2014, 01:11:26 pm

Title: tk2dtextmesh how to setfont which imported into a spritecollection in script
Post by: timchiang on January 03, 2014, 01:11:26 pm
I am trying to change the tk2dtextmesh font from script. But the font I was imported into a spritecollection as descripted here :http://www.unikronsoftware.com/2dtoolkit/docs/latest/tutorial/importing_a_font_into_a_sprite_collection.html

how can I do this ?

I found some script in the forum use code like this can load tk2dfontdata , but not spritecollection.
GameObject fontData = Resources.Load("TrollFontData") as GameObject;
textmesh.font = fontData.GetComponent<tk2dFontData>();

Could you give me some help?
Title: Re: tk2dtextmesh how to setfont which imported into a spritecollection in script
Post by: unikronsoftware on January 04, 2014, 11:01:05 pm
A font imported into a sprite collection also has a tk2dFontData created. It is created when you first add the font into the sprite collection. If you can't remember where you saved this, you can find this by clicking on the font in the sprite collection - then click on the Font data object to highlight it in the project window.