How do I make a typing effect?

  • I want text to appear letter by letter, like in games with lots of diolouge, along with the sound effects.

    I know I can do

    • Set Text to "H"
    • Wait 0.2 seconds
    • Set Text to "He"
    • Wait 0.2 seconds
    • Set Text to "Hey"

    but this seems extremely repetitive. I also know about Append Text, but again, repetitive and not very helpful in editor.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use a timer instead.

    Cheers.

  • Here's an example: https://www.dropbox.com/s/sdjm3mr2hspvl ... .capx?dl=1

    Both the typing speed and the complete text must be set by changing Text object variables as shown below:

    You can set them beforehand, like I did, or dynamically when creating the text, in which case I'd suggest a function for that.

    Hope this helps. Cheers!

  • Hi Bruno,

    Is it possible to add a sprite (e.g. cursor block) ahead of text?

    Regards,

    Roberto

  • I remember I did something like this a long time ago. I'll check if I still have the capx at home. Also, you could use an unicode block character as I mentioned on the other thread.

  • Hi Bruno,

    I was just thinking of a normal sprite. I'm currently on release 272 and yours seems higher. Will try resolving this first. I appreciate you coming back to me on this ;)

    Roberto

  • Hi Bruno,

    I've just updated my C2 and you've nailed it my friend - drinks on the house!

    You're amazing - Thankyou sooooo much.

    Roberto

  • Hi Bruno,

    Is it possible to change the input box for a normal text box - so it reads from that box instead of typing?

    I'm playing with it but getting some resistance.

    Regards,

    Roberto

  • Yes it is. I'm not sure exactly what you want to do, but you can read from anything, a text, an input, a variable, a string. What exactly is the effect you're trying to achieve?

    Cheers!

  • I'd like it to produce a paragraph of pre-type text if possible?

    Rather than typing the paragraph.

    Muchos Gracias,

    Robeto

  • So. This is one way of doing it.

    Click to advance the text.

    What I have there is a constant that has all text sequence separated by "|" and a variable (currentText) that controls which is the current text from that list. I have a function that creates a textbox and sets its completeText variable to the currentText from the constant. Every time I click, it increases the currentText by 1 and creates another textbox. Also, textboxes have a timer behavior that is started on creation.

    EDIT: There's also a condition to avoid clicking while the text is being typed. And you can change typing speed by changing the corresponding textbox variable.

    Any questions, just let me know.

    Cheers!

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