Read from embedded file - alternatives

I am loading data from embedded text files (word lists). I embed the files satisfactorily and can read them using Assets.getText(“myfile.txt”). I then parse each line into an array. The longest file is about 45000 lines (a word on each line) and in total I am loading about 200000 words in separate arrays.
As I do this at the beginning of the program there is a wait period of several seconds as the files are read and parsed. Is there a way to embed the arrays rather than creating them at startup so that there is no delay? OR would it be easier to create a splash screen and display this whilst the initial setup is done?
Thanks for any suggestions.

A splash screen is definitely easier. :slight_smile:
If you cared to get into using macros you could definitely create the parsed data at compile time. These might get you started in the right direction:

Thanks for the advice - much appreciated. I will just have to wrap my old brain around the process.

I had this tutorial bookmarked if that helps. I haven’t done much with macros yet myself.
https://jcward.com/A+Beginners+Guide+To+Hacking+Haxe+Macros

Thanks. Looks like easier reading!

1 Like