Hello Guest

Author Topic: Font can't find platform specific texture  (Read 3520 times)

robot-d

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Font can't find platform specific texture
« on: January 27, 2015, 12:39:20 am »
I can create sprite sheets for different platforms fine, but when I try to create on for a font I seem to get an error when I add the 2x size and click "commit." I can add the full-size (4x) font to my stage without a problem. My Font and all of the data files are in the folder /Assets/SpriteCollection/Fonts/FontName/. The "current Platform" for the sprite sheet is 4x. Here are my steps after that:

  • Resize the PNG for my font and add it to the folder /Assets/SpriteCollection/Textures/2x/FontName.PNG
  • Click "add new platform" in the SpriteCollection settings.
  • Select 2x from the dropdown.
  • Click "commit" on the SpriteCollection menu.

I then get this error:

UnityEngine.Debug:LogError(Object)
tk2dEditor.SpriteCollectionBuilder.PlatformBuilder:LogNotFoundError(String, String, String) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionPlatformBuilder.cs:285)
tk2dEditor.SpriteCollectionBuilder.PlatformBuilder:UpdatePlatformSpriteCollection(tk2dSpriteCollection, tk2dSpriteCollection, String, Boolean, Single, String) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionPlatformBuilder.cs:231)
tk2dSpriteCollectionBuilder:Rebuild(tk2dSpriteCollection) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionBuilder.cs:611)
tk2dSpriteCollectionEditorPopup:Commit() (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:446)
tk2dSpriteCollectionEditorPopup:DrawToolbar() (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:436)
tk2dSpriteCollectionEditorPopup:OnGUI() (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:889)
UnityEditor.DockArea:OnGUI()


Any help would be greatly appreciated!  ;D

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Font can't find platform specific texture
« Reply #1 on: January 27, 2015, 11:19:33 am »
You can't just rescale the font texture. From the docs -
http://2dtoolkit.com/docs/latest/advanced/platform_specific_sprite_collections.html

Quote
The same rules apply to fonts. 2D Toolkit will now parse your bmfont to find the appropriate texture, so you won't need to rename the texture. If in doubt, export from your font package using the full @platform filename instead of renaming it once it has been exported.

Basically, you export your fonts at 2x into the folder (you'll need a 2x .fnt file as well)

robot-d

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Font can't find platform specific texture
« Reply #2 on: January 27, 2015, 02:45:15 pm »
Ah that makes sense. Thank you.