how do you use a loop to display text one letter at a time on the screen

emojiemoji Member, BASIC Posts: 66

hello, so far

I have a lengthOfLength = textLength(game.textValue). and it good but now I want to use a loop 

So I can print the text one letter at a time out to the screen. the problem is the while loop is not working just from the basic example, the game.lengthOfText is greater then 0 . can someone explain what is wrong with the code?

Comments

  • ArmellineArmelline Member, PRO Posts: 5,397

    I wouldn't use a loop for that. They're fast, too fast for a good "adding letter" effect even if you set it to 1 loop/frame.

    I made a version of this a long time ago. I just had a quick look and it seems fine, but there's probably a better way to do this.

    The art and sounds are not free to use, I have no idea where I got them or what the usage rights are.


  • emojiemoji Member, BASIC Posts: 66


    i look over your but it's

    too much info for a novice like me to digest. the problem seem to be the textSubStr(text, startIndex, endIndex) i ran this and it say invalid expression

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Here is a little version I worked up while @Armelline was beating me to the punch of uploading. This doesn't have any of the fancy line returns and scrolling text, it will just type out each letter one by one. Adjust the Timer to make it print faster or slower.


  • emojiemoji Member, BASIC Posts: 66

    oh sweet thank you!

  • ArmellineArmelline Member, PRO Posts: 5,397

    No worries, it was a more indepth example made for someone years ago, rather than exactly for your (rather vague) use case. Jamie's example is much better and to the point.

Sign In or Register to comment.