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

Pages: [1]
1
Support / Re: Ok, I give up! How do you load a font in code?
« on: December 06, 2015, 07:10:45 pm »
It's fine, it's not invisible.  It's off-screen, because my scaling isn't right for the font.  Disregard!

2
Support / Re: Ok, I give up! How do you load a font in code?
« on: December 06, 2015, 03:29:21 am »
Nevermind.  It's doing exactly what I told it to do.  Bit of a scaling issue throws it off the screen!

3
Support / Ok, I give up! How do you load a font in code?
« on: December 06, 2015, 03:23:20 am »
I have a working font prefab.
I can use the font in the GUI editor.  I want to assign the font in code.

GameObject font = Resources.Load ("gui/HardpixelFontdata") as GameObject;
tk2dFontData fontdata = font.GetComponent <tk2dFontData>();

And then on an existing.. tk2dTextMesh object

tk2dTextMesh textmesh = option.GetComponent <tk2dTextMesh>();
textmesh.font = fontdata;

The text is invisible!  If I don't set the font in code, it's fine.  No errors are outputted to the console.

Pages: [1]