Display text "one word at a time"?

New releases and general discussions.

Post » Fri Nov 14, 2008 2:03 am

This is hardly important, but I was wondering if this could be added to the text box object sometime in the future.

Instead of displaying the entire contents of a text box all at once some games make the sentances appear one word at a time, sort of like a typewriter effect. Usually you can speed up the typing by holding down an action key.

Adjustable speed settings would be nice, as well as maybe an option to print the text one line at a time rather than one word.

(sorry if this is already possible... I didn't see any options related to it)
B
4
S
2
G
4
Posts: 401
Reputation: 2,302

Post » Fri Nov 14, 2008 2:25 am

See GetToken and NumTokens in System Expressions. Shouldn't be too hard to figure out how to do it from that.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Fri Nov 14, 2008 2:51 am

Okay, thank you.
B
4
S
2
G
4
Posts: 401
Reputation: 2,302

Post » Sat Nov 15, 2008 2:56 am

Just posted something that might be of interest for you Caspis. :)

[url:z546q7i2]http://www.scirra.com/phpBB3/viewtopic.php?f=16&t=1995[/url:z546q7i2]
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sun Nov 16, 2008 2:14 pm

The code I've been using is:

1.System: 1Start of layout
> TextManipulatorSet string to TexttoDisplay 0 .Text

2.displayText: 27 Text is TextManipulator 0 .GetString (case: No)
> displayTextSet text to TextManipulator 0 .GetLeft(displayText 1 .Value('currentdisplay'))
> displayTextAdd 1 to 'currentdisplay'
//IE: Are the 2 strings not equal?

3.Button: 18 On Button clicked
> TexttoDisplaySet text to "This is typing!"
> displayTextSet 'currentdisplay' to 0
> TextManipulatorSet string to TexttoDisplay 0 .Text
--------

This is the important part here:
"TextManipulator.GetLeft(displayText.Value('currentdisplay'))"
it uses 2 strings: 1 to hold the text, and the other to display it. :D
B
2
S
1
G
4
Posts: 156
Reputation: 1,612

Post » Mon Nov 17, 2008 12:45 am

I was hoping that there was a better way to do it then what I found over the weekend... :oops:

[url:2ng2g7dh]http://www.mediafire.com/?sharekey=705bbd0e250d4aa1d2db6fb9a8902bda[/url:2ng2g7dh]

I checked out the System Expressions section like Ashley suggested and the "Left" function sounded like what I wanted. It works... but its really tedious since it seems like you can input a number and only a number for the amount of characters that you want to have displayed.

I was hoping that there was a way to tell it to do a series of numbers or something like that, but it looks like Pixelrebirth and ansmesnobody already have a better way of doing it. Sooo... never mind.

-thanks!
B
4
S
2
G
4
Posts: 401
Reputation: 2,302


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests