[Textbox] How do I change text color of a single line?

Get help using Construct 2

Post » Thu May 22, 2014 2:01 am

I have read the section "Styling Textbox objects" textbox manual in www. scirra.com/manual/117/textbox but I can't find a way to make only a line in the text box to be colored. Is it even possible?

I would like it to look something like this:
------------------------------------------------------------------
Enemy is approaching
You received an item
------------------------------------------------------------------

Or even better only a piece of string in a line:
------------------------------------------------------------------
Enemy: is approaching
You: received an item
------------------------------------------------------------------
I have tried to use the "Set CSS style" action to change the text color but it changes the color of every single text which is what i don't want. It looked something like this:
------------------------------------------------------------------
Enemy is approaching
You received an item

------------------------------------------------------------------
Any help would be appreciated :)
B
3
Posts: 3
Reputation: 181

Post » Thu May 22, 2014 2:53 am

This is very easy to do but difficult to explain. Ill try to upload a capx for you in a bit.

Edit:
Look at the image below and adjust it accordingly to suit your game. Hope that helped.
You do not have the required permissions to view the files attached to this post.
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Thu May 22, 2014 3:08 am

Thank you for helping. But I think you misunderstood my problem.
I'm trying to change the color of a single line of text in a Textbox and not a Text
I attached a screenshot of my textbox
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 3
Reputation: 181

Post » Thu May 22, 2014 4:05 am

It would be the same concept. Just add the colour change before the text is added.
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Thu May 22, 2014 4:22 am

If i use the "Set CSS style" action for my Textbox then everything will become red
The only option i can think of right now is making a new Text object for every message sent instead of using the Textbook object which would be a hassle
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 3
Reputation: 181


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests