Achieving a Cleaner Typewriter Effect in C2?

Get help using Construct 2

Post » Tue Apr 16, 2013 10:27 pm

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?
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Sun Jun 30, 2013 1:16 pm

Hey dude, did you manage to learn that!? :D
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Mon Jul 01, 2013 6:19 pm

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 :P
Last edited by Dalal on Sun Apr 20, 2014 3:58 am, edited 1 time in total.
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Mon Jul 01, 2013 6:58 pm

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.
B
17
S
7
G
4
Posts: 461
Reputation: 5,907

Post » Mon Jul 01, 2013 9:17 pm

@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.
B
44
S
13
G
7
Posts: 338
Reputation: 10,389

Post » Mon Jul 01, 2013 9:25 pm

This is a great example. Thanks man! This answers my original question.
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Tue Jul 02, 2013 4:39 am

Fantastic example! :D
Pin this one down, @Kyatric *shoots red flares*
B
107
S
40
G
10
Posts: 456
Reputation: 13,202


Return to How do I....?

Who is online

Users browsing this forum: mjj1990 and 8 guests