[SOLVED] Typewriter effect within a function?

Get help using Construct 2

Post » Fri Jan 20, 2017 7:04 am

So I'm trying to create a typewriter effect for strings that I pass into my game. This has been done before, although I'm trying to work it into a function. So that way I can call the function whenever I want passing the string I want displayed as a Function.Parameter. I have it working to some extent, I can achieve the effect when the source text is stored in a global variable. I cannot pull from the function.param(0) for some reason. I tried storing the parameter into a local variable and it didn't work with that either. Any thoughts on this? .Capx link below.

Two Sprite Fonts one pulling from the Function.Param(0) the other a global variable. Spacebar triggers the function in this instance.


https://dl.dropboxusercontent.com/u/729 ... riter.capx
Last edited by VictoryX on Fri Jan 20, 2017 7:43 pm, edited 1 time in total.
Image
B
46
S
17
G
2
Posts: 201
Reputation: 4,526

Post » Fri Jan 20, 2017 7:40 am

You can't bury Waits in a function. The function puts all those Waits to the side and immediately returns, so your parameters are gone by the time the code runs. Use a Timer.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Fri Jan 20, 2017 11:13 am

Not sure how incorporating a timer into the code I have would rectify the situation. Could you please elaborate?
Image
B
46
S
17
G
2
Posts: 201
Reputation: 4,526

Post » Fri Jan 20, 2017 2:40 pm

ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Fri Jan 20, 2017 7:42 pm

Oh wow that is really really interesting! I don't think I would have come up with this way of doing it. Thank you very much this works very well for my problem.
Image
B
46
S
17
G
2
Posts: 201
Reputation: 4,526


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 36 guests