How do I bbcode text box?

0 favourites
  • 6 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • Here is what I am trying:

    The user gonna type some words in the (Text Box) and than certain words will have different colors


    Banana will be yellow

    Apple will be Red

    //// I have the Rex bbcode plugin

  • There you go but without plugin:

  • I think MegaMente may actually have been asking for a system that dynamically changes the colour of text as the user types things in at runtime, rather than just hardcoding BBCode in the editor.

    You could try doing something like this to process the user's text before it goes to the output text box:

    • Make a variable (userText)
    • put user's input in userText (from whatever you are using to capture it)
    • set userText to: replace(userText,"banana","[color=#FFFF00]banana[/color]")
    • set userText to: replace(userText,"apple","[color=#FF0000]apple[/color]")
    • etc
    • Set output textbox.text to userText

    This means that if the user types in "I'd like a banana but not an apple", your game will convert that into "I'd like a [color=#FFFF00]banana[/color] but not an [color=#FF0000]apple[/color]" before it shows it on the screen.

    Note that you might have to do a bit of work to cover word variants (eg. capitalised versions, plurals).

  • Or the fact the OP is mentioning Text Box instead of Text Input suggests the issue is for Construct 2 rather than Construct 3 (especially mentioning a third-part addon).

    Moved to Construct 2 forum.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I will see what I can do... Yes Mikehive understood what I am trying to do

    Thanks you two anyway!!! :D

  • Moved back to Construct 3 forums then.

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