Conditional statements on text entries for TextBox

Get help using Construct 2

Post » Fri Aug 05, 2016 8:57 am

Hi all,

When i'm pushing text to the textbox, it only seems to be in the one colour as defined within the CSS. If you don't define it, it's just black I think.

To my knowledge there doesn't appear to be any conditional statement on CSS that I can use to make different entries in to the textbox different colours.

As an example to what i'm looking for when the player is looking at the textbox:

You are hit for x damage.
You hit for x damage.
x mob dies
x mob drops x loot

Is it not possible, or am I missing something very simple? I'm not an expert in CSS so i'm hoping it's something I just don't know yet!

Thanks for your time.
In development: Avalon Isle
B
12
S
4
G
1
Posts: 44
Reputation: 1,496

Post » Fri Aug 05, 2016 11:57 am

I don't think this is possible in C2. This plugin ( plugin-tag-text_t92363 ) might do it in the same textbox, I don't know for sure.
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Fri Aug 05, 2016 1:51 pm

If that plugin doesn't work... the only way to do it is to make a custom text feed using a bunch of boxes stacked on top of each other (one for each line)... then push the text and css styling to each box going up/down each "row".

It can definitely be done, but it will be a fun job to make it happen. Probably a simple state machine to store each text value and style, then bump it up to the box above or whatever - until all boxes for your chosen number of lines is completed.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Fri Aug 05, 2016 4:04 pm

Thanks both. I will give this is a try when I get home. The plug in, looks like it might work for me.

The text boxes could also work but shit that don't half look like an unfun job! Also I want the user to be able to scroll through the past text which is easier in the textbox (that I can see).
In development: Avalon Isle
B
12
S
4
G
1
Posts: 44
Reputation: 1,496

Post » Fri Aug 05, 2016 4:18 pm

Conditionals:

hp<10 ?rgb(255,0,0) :rgb(0,0,0)
Image ImageImage
B
172
S
50
G
183
Posts: 8,442
Reputation: 115,603


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests