Custom CSS for one word (a text variable) in a text object

  • Hello guys, I have been trying to resolve this concept of having a custom CSS for a text variable (one word) inside a text object, but with no luck.

    I checked several plugins (Rex's BBcode and Tag text) but it does not give the requested result..

    Below is what i am trying to achieve

    "This is a " & [text variable] & " text."

    RESULT:

    This is a

    BIGGER

    text.

    Thanks :D :D

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    Don't know about CSS for just one word, but you can always use "sprite font plus" plugin if you can work wih all letters being capital,

    As we can set alphabets code in it to use for a spritefont we upload in it, we can work with it.

    The way is to create two sets of characters, one Simple and one bold and use simple set for non capital letters and Bold letters set for Capital Letters.

    For Example : typing "a" will show "A"

    while typing "A" will show A

  • Thank you shubhamrathi9, this is a nice workaround.

    Nevertheless. I am looking for a more advanced feature that allows me to use different font, color and size for a text variable inside a text object.

    Still looking for solutions, hope others have some ideas :)

    Cheers

  • I got a workaround for the effect I wanted. The steps are as below:

    I created a regular Text Object, a BB Code Text Object and a text variable that is going to change.

    I used the text object to construct the string that I will use in the BB code text that supports BBcode.

    This is how I constructed the text input and I included the text variable inside of it: "

    " &kidname & "

    [/color][/size]"

    Now I will consider that the variable is a name so the output of the string is going to be a BBCode with the name ziad inside of it: "

    Ziad

    [/color][/size]"

    So I take all this string and I assign it within a BBcode text like this:

    "Hello, My name is "& TextBox.Text &"." and it was a magic moment where my text variable is beautifully colorful within my text..

    Hope this could help...

    Cheers

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