0 Favourites

Achieving a Cleaner Typewriter Effect in C2?

  • Basic implementations of the 'typewriter' effect fail to account for word wrap. Because of this, you see several amateur applications where words that are being typed out suddenly 'jump' to the next line. This looks unprofessional and is undesired in most cases.

    What are some ways in which a cleaner typewriter effect can be achieved in C2, where words that should end up on the next line start out on the next line, to avoid the 'jump'?

    So far, one possibility I've thought of is to use the 'text height' expression of the text object to 'peak' at the next word before typing it out. If the text height changes after the word, then start it out on the next line. If not, spell out the full word. In this manner, you would go word by word and it would cleanly type everything out.

    Are there any better approaches you can think of?

  • Hey dude, did you manage to learn that!? :D

  • I put a hold on the project I was working on at that time, so I never really got around to finding a solution.

    The best approach I can think of straight off the bat is to use a Sprite Font with fixed width. Knowing the width of the characters, you could anticipate when a word will flow to the next line and place it there beforehand using a line break. That would be the general idea.

    Also, I recently saw another C2 game (can't remember which one) that had this same problem, but seemed professional in almost every other way. It really bugs me because I haven't seen a single professional release that messes this up, yet most beginners implementing the typewriter effect don't seem to mind the visible word wrap. It looks disgusting to me

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I would use a hollow letter in a sprite font, like � attribued to a false white space. I would then write the whole text, replacing every letter that shouldn't be discovered by my � placeholder. The word warping will make it so the text will immediately take its final position (if the characters are of the same width at least) and I could "uncover" every letter one by one.

  • Dalal

    @gammabeam

    One option is to create your own word wrapping system using events. Here's one way to do it that wraps in between words.

    Demo

    Capx (annotated)

    I hope this helps.

  • This is a great example. Thanks man! This answers my original question.

  • Fantastic example! :D

    Pin this one down, Kyatric *shoots red flares*

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)