playMaker

Author Topic: Simple way to load a markup text to string  (Read 2099 times)

parallel

  • Full Member
  • ***
  • Posts: 155
Simple way to load a markup text to string
« on: February 05, 2014, 02:07:27 AM »
Hi, I've checked the array/data-maker samples, but this is still foggy territory for me (without any video/visual tutorials). The only action I see relating to text is 'Split text to array'. I simply want to load pages of markup text for DFGUI labels from an external text file (and later on do localisation from spreadsheet), preserving the text as is. Any hints?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Simple way to load a markup text to string
« Reply #1 on: February 05, 2014, 04:33:04 AM »
Hi,

 Can you not import that text file into your project? does is really have to be outside the project, even at runtime?

http://hutonggames.com/playmakerforum/index.php?topic=5224.msg24895#msg24895


bye,

 Jean

parallel

  • Full Member
  • ***
  • Posts: 155
Re: Simple way to load a markup text to string
« Reply #2 on: February 05, 2014, 05:07:56 AM »
No it doesn't have to be outside or at runtime, it just needs to be edited outside unity as I haven't found a markup editor or even just a proper text editor for unity yet.

I can't get that action to work, maybe I'm writing the path wrong. I've tried Resources, Resources/name and Resources/name.txt. Or does the path need to be relative to the custome PM actions folder?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Simple way to load a markup text to string
« Reply #3 on: February 06, 2014, 04:28:32 AM »
Hi,

 no. The resources folder act as root so no need to mention them, also Unity is gathering ALL "Resources" folder into one single root, so you can have several "Resources" spreaded out on your project, they will become one eventually.

http://docs.unity3d.com/Documentation/ScriptReference/Resources.html

If you study XmlMaker demos, you will see how resources are referenced. And on top of that, you can simply reference any text file in the project from actions, it doesn't matter actually.

bye,

 Jean