[solved]How do I load plaintext text into a text object?

Get help using Construct 2

Post » Thu Jul 10, 2014 12:36 am

How do I load plaintext text into a text object?

I seriously have no idea, and search comes up with no mention. It's a largeish text.

Thank you :)
Last edited by damjancd on Tue Jul 15, 2014 2:08 am, edited 1 time in total.
B
38
S
6
G
1
Posts: 306
Reputation: 2,902

Post » Sat Jul 12, 2014 2:20 am

Bump.
Pretty Please?
B
38
S
6
G
1
Posts: 306
Reputation: 2,902

Post » Sat Jul 12, 2014 6:21 am

When you click on the text box there is a menu on the left side, scroll down to properties and change the text in there.
B
3
Posts: 2
Reputation: 175

Post » Sat Jul 12, 2014 7:56 am

I am guessing that you want to load the text from an external file, like txt document..? If yes, I would also like to know.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Mon Jul 14, 2014 6:27 am

@eli0s Exactly. That's what I wanted to know. Use Json or something? How would that work? What's the simplest way, and fastest?

On set text, my project lag CONSIDERABLY on the ipad and iphone 5S. I can't have that. It drops to 5 FPS, from a constant +60
So I was considering not using "set text" or "append" but to load it from an external file.

@jakepugh15 I meant through code, on runtime, not via project. Sorry I wasn't clear.
B
38
S
6
G
1
Posts: 306
Reputation: 2,902

Post » Mon Jul 14, 2014 4:41 pm

@damjancd , although I don't know if json is the way to do it (I believe you're right though), I suspect that the Text object is responsible for the low frame rates on your tablet and phone.
Have you tried the Spritefont object instead? It's supposedly much faster than the regular Text object.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Mon Jul 14, 2014 6:38 pm

External files can be loaded via AJAX and Project Files. First import your file (right click on the "Files" folder -> Import files). Then use AJAX to request a project file, select your file, and with the "On completed" AJAX trigger, set your text object to AJAX.LastData
B
74
S
31
G
26
Posts: 994
Reputation: 20,198

Post » Tue Jul 15, 2014 2:08 am

@Magistross, THANK YOU. I will check this out immediately.

@eli9s I can't use sprite font since I have a lot of text formatting, I use verdana and I there is letter specific kerning there. I sure hope AJAX works faster on tablets.
B
38
S
6
G
1
Posts: 306
Reputation: 2,902

Post » Tue Jul 15, 2014 3:06 am

@Magistross It's working and fuckyeah and thankyou and fuckyeah. Even if the text object is still slow on cocoonJS, this is a superior way to load text for me. May you find 500 000 dollars on the ground, randomly, today.
B
38
S
6
G
1
Posts: 306
Reputation: 2,902

Post » Tue Jul 15, 2014 11:18 am

@Magistross , I thank you also for your instructions :)

I would like to stretch the topic a bit and ask you something else too:

Is there a way to stream separate lines of text (or paragraphs) from the same txt file? You know, for building dialog systems or create cut-scenes that each "balloon" has its own paragraph of text. I am sure that having multiple txt files loaded with AJAX for each line is not the way to do dialogs...
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests