How to show text in field over the time

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
pkmittal
Posts: 111
Joined: Thu Feb 08, 2007 11:27 am
Contact:

How to show text in field over the time

Post by pkmittal » Wed Mar 16, 2016 4:01 pm

Hi, I want to show the pre-defined long text of the field paragraph as a story telling experience. Each character of the field should be displayed in 10 miliseconds.. so that a full paragraph can be shown in let say X seconds.

Field contain the rich formatted Text. It should look like as some one is typing the field message character by character. Can you please let me know how to do that ?

Thanks
pkm

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: How to show text in field over the time

Post by dunbarx » Wed Mar 16, 2016 4:07 pm

Hi.

So much fun.

Raspberries to youse others.

Sorry pkm, inside joke.

Make a field with some text in it, make another field. Now make a button, and put this in its script:

Code: Select all

on mouseUp
   put field 1 into tText
   repeat for each char tChar in tText
      put tChar after field 2
      wait 10 milliSec
   end repeat
end mouseUp
Craig Newman

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: How to show text in field over the time

Post by Simon » Wed Mar 16, 2016 4:25 pm

Wait-a-sec....
What about "type"?
See dictionary :)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

pkmittal
Posts: 111
Joined: Thu Feb 08, 2007 11:27 am
Contact:

Re: How to show text in field over the time

Post by pkmittal » Wed Mar 16, 2016 4:28 pm

Thanks. It works. However I wanted to have the same color and fonts in the destination field.. How can I change the color and font size of the destination text when I am assigning the text in the field dynamically..

pkmittal
Posts: 111
Joined: Thu Feb 08, 2007 11:27 am
Contact:

Re: How to show text in field over the time

Post by pkmittal » Wed Mar 16, 2016 4:33 pm

Thanks Simon, Type makes it even more easier..

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: How to show text in field over the time

Post by Simon » Wed Mar 16, 2016 4:33 pm

ooops.. RTF forgot about that.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

pkmittal
Posts: 111
Joined: Thu Feb 08, 2007 11:27 am
Contact:

Re: How to show text in field over the time

Post by pkmittal » Wed Mar 16, 2016 4:51 pm

But good to know Type command. But even the other code does not preserve Rich Text format

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: How to show text in field over the time

Post by Simon » Wed Mar 16, 2016 4:53 pm

Use Craig's method and check out "RTFText".

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”