Custom typewriter behavior that processes BBcode tags first?

0 favourites
  • 6 posts
From the Asset Store
Keyboard, Mouse & Typewriter SFX / 27 Unique Sound Clips
  • If you use events to make a typewriter effect for text/spritefont, and add BBcode tags to it, the BBcode tag itself will be typed out / visible until the closing bracket is complete.

    The built-in typewriter behavior fixes this by processing the BBcode tags before typing out the text. However, I can't use it because the speed of the typing effect is based on the length of the string, which is undesirable for my game and, well, any game for that matter. Suggestion thread for that here.

    That said, is there some workaround I can do to have my own typing effect process the BBcode tags before typing out the string? I've tried using a combination of intermediary text object & .PlainText but it didn't work.

  • Hey, I made Spritefont deluxe that fixes that issue.

    Unless you decide to write a parser that parses the tags, remove them, typewrites and adds them back, I'm not aware of a method that fixes it using events only.

    Here is a preview of what spritefont deluxe for C3 does (it's a behavior that gets added on top of the default spritefont plugin)

    twitter.com/skymen75/status/1135240840589320192

  • You need to parse the text and wrap each character in bbcode tags before outputting to the screen. Here is a simple demo which supports bold text only, you can easily add other tags:

    dropbox.com/s/dig4l55be35kznq/BBCode_Typewriter.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The PlainText expression of the Text object gives you the text with all the tags stripped out. So can't you just calculate a time based on the length of that string?

  • Sure that should be possible, but I still think that this should not be the default. Most people will want typewriter with fixed typing speed, not fixed duration no matter the length of the string.

  • Also the PlainText expression doesn't exist on the Sprite Font object type for some reason! You can copy the text to a separate Text object to get the PlainText there as a workaround, but it's a bit inconvenient.

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