Text with more then one color

Get help using Construct 2

Post » Wed Jun 05, 2013 5:16 am

Hi,

How to create a text object which has more then one color (designer could assign the color of each character)? It seems only one color in a text object.

For example,
Hi
Hi

rexrainbow2013-06-05 05:19:48
B
109
S
27
G
276
Posts: 4,479
Reputation: 154,418

Post » Wed Jun 05, 2013 10:08 am

Hey,

The code of the text plugin doesn't seem to enable such a behavior. Only once color is saved in the object, the only function setting the color is overwriting it, and it is only used 2 times in the whole object : savetoJSON, and draw, witch fills the whole text with the selected color. Sounds like this needs a specific plugin for such a behavior, or multiple texts :/
B
17
S
8
G
4
Posts: 473
Reputation: 6,211

Post » Wed Jun 05, 2013 10:24 am

@Guizmus

Since @Ashley said Please do not adjust official plugins or behaviors, it is better to build this feature in official text plugin. I thought it could change color by added some code.rexrainbow2013-06-05 10:28:04
B
109
S
27
G
276
Posts: 4,479
Reputation: 154,418

Post » Wed Jun 05, 2013 1:36 pm

@rexrainbow

I know creating copies of a built-in plugin or behavior is bad, I don't suggest you do it at all, but you know this a lot better than me.
I spent some more time inside this plugin code though, and I don't see any way of doing what you describe with the core plugin without adding any javascript.
Of course, creating a "text_ext" behaviour that would overwrite the draw function could do the trick too, but I have hard time finding a good way to store texts and color in the behavior parameters.

There seem to be another way though, by creating a plugin that would automatically create N text objects and manipulate himself, each text object being of one color only. This would require, for what I know, to link the 2 object types at the start of the layout (a little like this plugin) so the "multicolored text" would know what to create. This could be impossible to propagate the Pin behavior though, no idea, you may know better.

Sorry if this didn't help, I tried my best ^^
B
17
S
8
G
4
Posts: 473
Reputation: 6,211


Return to How do I....?

Who is online

Users browsing this forum: newt, totoe and 8 guests