How do I efficiently do a text wipe effect?

Get help using Construct 2

Post » Sat Apr 25, 2015 1:42 am

OK so we've all done the typewriter effect with our text. It's nice, but sometimes it's not what you need. I'm looking to do something similar to how text is displayed in the game Dragon's Crown. Example: https://youtu.be/6hIlfSCP0zI?t=5m15s

Notice how the text is almost displayed in a typewritery manner, but it's really wiped onto the screen? Or maybe a better way of saying it is it's faded into view. It's not a harsh typewriter, but rather a wispy, flowing text. Now I did figure out how to do this. The thing is, it's not efficient at all. It involves calling upon a "wipe" bullet sprite and having it destroy when it hits something. Using it once or twice is ok, but to use it for all of the text in the game is just outlandish. For example: https://dl.dropboxusercontent.com/u/62554382/CAPX/TextWipe.capx

Notice how it's not really the BEST way of doing it? imagine doing that for all your text in a game. No bueno!

I did some research on my own, and although I haven't come across the solution, I think I might be getting somewhere. I know that a sprite font will have to be used. There's no way this can be done properly with a simple text object. I found this tutorial on sprite fonts: https://www.scirra.com/forum/suggestion-sprite-font_t62663, but the thing is, I didn't completely understand how it works. I tried plugging in a fade-in function at certain points, but the best I could muster is getting all of the text to fade in at once.

How do I do this fade in/text wipe efficiently?
B
6
S
1
Posts: 31
Reputation: 703

Post » Sat Apr 25, 2015 6:41 am

Why would it be outlandish?
Wouldn't it just be calling a function every time a text is either created or changed?

I guess for creating an effect like this some sort of masking is the only visually satisfying way.
Instead of using a sprite with bullet behaviour you might opt for a 9-patch object and chance it's width.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Apr 25, 2015 11:17 am

I'd probably go with a mask with spritefont to get that exact effect.
B
15
S
5
G
7
Posts: 876
Reputation: 5,650

Post » Sat Apr 25, 2015 3:36 pm

Thanks for the feedback! Maybe I'm still thinking inside the box. It looks like I need to rethink my process if I were to use a function. My thoughts on it being outlandish were having to recreate the "wiper" at exact spots all over the layout. Maybe I can pull the XY value of the text object I use every time the function is called, and maybe instead of destroying the wiper, I cam have it go off-layout until I'm ready to use it again. I need to do some serious thinking on this one.

Not much experience with 9-Patch. I guess it's time O familiarize myself with it. Thanks again! If y'all have any more ideas while I'm trying to figure this out, please let me know.
B
6
S
1
Posts: 31
Reputation: 703

Post » Sat Apr 25, 2015 9:25 pm

Masked Text Reveal

Been a while since I played with masks and couldn't get it working right with a coloured background. Brain drained tonight and didn't have enough time to toy with it. Hopefully you'll have better luck. It's a start at least ;)
B
15
S
5
G
7
Posts: 876
Reputation: 5,650


Return to How do I....?

Who is online

Users browsing this forum: richcoz81 and 48 guests