How do I apply BBCode inside of a Text object?

0 favourites
  • 10 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • How can I use BBCode to apply style to a certain word in a Text object.

    For example: "<b>Hello</b>, I am a <color=#fff>regular</color> string."

    I don't want to use a million Text instances to accomplish that..

  • How can I use BBCode to apply style to a certain word in a Text object.

    For example: "<b>Hello</b>, I am a <color=#fff>regular</color> string."

    I don't want to use a million Text instances to accomplish that..

    <b>&"Hello"&</b>&", I am a"& <color=#fff>&"regular"&</color>&" string."[/code:2fi2hany]
    
    something like the above if you want to use the code inside the text itself, however Construct doesn't allow css directly in the text you have to manually edit it by events using a text input object and not a text object... and find each specific word and give it a css based on the text case sensitivity, however might be a headache, id just use sprite fonts or sprites directly instead of text, if that is just a message you want to use. 
    
    also it might work with js ... but ehm there not enough tutorials around about this. may i ask what is that you want to achieve? in what context like behavior will be used? that way il probably be able to help better.
    
    to use css on text inputs see this [url=https://www.scirra.com/tutorials/1283/easily-add-css-effects]tutorial[/url] < for C2 runtime and C3. if C3 runtime is not usable yet since is experimental.
    
    edited: i was about to say might be supported in C3 runtime, as Ashley said bellow.
    
    However personally i noticed, C3 runtime might not be compatible with some behaviors or plugins yet since is still in development.
  • It's currently supported in the C3 runtime. It's still experimental so is not in the manual yet but this forum post lists the tags you can use.

  • I read through your post on that yesterday, but I really couldn't figure out how I could implement anything, since there were no examples. I have the experimental features enabled, but I don't see the BBcode option on the Text or Text Input object. Ashley

    I need it to extend my narration text system, the system is already done via the Text object. It's basically a ton of text's getting written inside the Text object at all times. Like a chat being written by just one person and on text object that gets text, writes it and then clears the object, writes once again etc. And I prefer not using Text Input for things like that since, that is a text input and is made for getting input from the user.

  • See this blog post for information on how to try the new runtime.

  • Hi Ashley,

    I hope you are doing well. I have a weird question: I am unable to see any links, quotes, images, etc on these forums ... why is this? All I see is shortcode. For example, your last comment in this thread appears like this to me:

    "See this blog post for information on how to try the new runtime."

    Please advise. Thanks!

    Best regards,

    Belal

  • bsweileh

    Hi Ashley,

    I hope you are doing well. I have a weird question: I am unable to see any links, quotes, images, etc on these forums ... why is this? All I see is shortcode. For example, your last comment in this thread appears like this to me:

    "See this blog post for information on how to try the new runtime."

    Please advise. Thanks!

    Best regards,

    Belal

    Ashley has nothing to do with the forum - Tom is the main website guy.

    Also, anything to do with the forum/websites is obviously a 'Website Issue', so please post any issues you may have in the correct location.

    Cheers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh, sorry about that ... I only posted this because I wasn't able to see the instructions and links for applying BBCode inside a text object. Thanks for the reminder, I'll be more mindful next time.

    I have been able to apply BBCode inside a text object. Question though: Are the [LTR] and [RTL] tags supported? While Construct 3 supports the Arabic language and other RTL languages extremely well, it still can't handle cases where a mixture of RTL and LTR languages/characters are in the same text object (or cases with lots of punctuation).

    As for Text Input objects, they work flawlessly since we can apply the CSS style direction="RTL" or "LTR" as needed depending on the dominant language to be typed. Unfortunately, we cannot apply the same style to Text objects, and it is because of this that things get a bit messy.

    Attached is an example that shows Arabic text that has been input by the user appears from right-to-left (RTL). The same text is copied to the Text object and appears as left-to-right (LTR). While adding newlines to the text can fix some directionality issues, some other characters (such as numbers, exclamation marks, periods, and other punctuation often) appear in the wrong parts of the sentence.

    tinyurl.com/y7uzvujc

    tinyurl.com/y8tcgdqb

    Is there a solution to this? Please advise. Thanks!

    Best regards,

    Belal

  • Ashley I think the question is very clear: How do I apply the BBCode to a text object like Text Input? I urgently need that feature, too.

    I cannot find the "Enable BBCode" option in the Text Input object. I know I can use the CSS format, but if I want to modify the characteristics of a single word (for example the color), I CANNOT do it.

    I hope that this apparently simple problem can be solved. Greetings.

  • Inkaendum, please see Ashley's quotes below about enabling the new runtime and BBCode support.

    See this blog post for information on how to try the new runtime.

    It's currently supported in the C3 runtime. It's still experimental so is not in the manual yet but this forum post lists the tags you can use.

    After enabling the Construct3 Runtime in the project's Properties Bar under the "Advanced" section, you can then create a text object and find the "Enable BBCode" checkbox under its properties. See the following link: bit.ly/2OF3FSg

    As far as I know, "Enable BBCode" isn't in the Text Input object. Is there a particular reason why you would find it useful there? Text Input is for getting input from the player. Is there a reason why you would need the player to input BBCode into the Input box?

    Hope that helps!

    Best regards,

    Belal

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