Does LoadString have to be txt extention?

Monkey Forums/Monkey Programming/Does LoadString have to be txt extention?

ondesic(Posted 2012) [#1]
I wanted to load the string data from a .fnt file. However, unless I change the extension to .txt, it won't read. Is this normal?


GfK(Posted 2012) [#2]
I think it only reads txt or json files, not 100% sure tho as i'm on me ipad and can't double check.


Volker(Posted 2012) [#3]
Yes. But you can change this behaviour. Use
#TEXT_FILES="*.txt|*.fnt"
at the beginning of your project.


Rushino(Posted 2012) [#4]
Is there a particuliar reason it is .txt, .xml, .json ? Its is dependent on the target ? If i want like .something will it still work with others devices ?


therevills(Posted 2012) [#5]
Check the CONFIG.TXT, you will see:
TEXT_FILES=*.txt|*.xml|*.json


So by default all targets will load txt, xml and json.

And as Volker has stated you can change this in code using the precompiler or you can change the CONFIG.TXT in your build folder.

Because I use Tiled alot, I always add tmx:
#TEXT_FILES=*.txt|*.xml|*.json|*.tmx


This basically acts as a filter, any files which arent included do not get copied to your build folder.


ondesic(Posted 2012) [#6]
Perfect. Thanks