Jump to content
snkman

Changing text size and color within hint format?

Recommended Posts

Hey guy's,

is it possible to use the "structuredText" within hint format?

Example:

_text = parseText ("<t color='#f00000ff' size='1.5'>Nice Text!</t>");

hint format ["%1", _text];

I know this doesn't work but i'm looking for something like this.

I have a "hint format" with displays the content of several arrays but i need to change the color and size of one line only and the others can use the default color and size.

Share this post


Link to post
Share on other sites

_num1 = 1;

_num2 = 2;

_num3 = 3;

_Stxt = parseText format

["

<t color='#ffff00'>Yellow = </t><t color='#FFFFFF'>%1</t><br/>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br/>

<t color='#99D5FF'>Blue = </t><t color='#FFFFFF'>%2</t><br/>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br/>

<t color='#FF3B3E'>Red = </t><t color='#FFFFFF'>%3</t><br/>

", _num1, _num2, _num3];

hintSilent _Stxt;

output:

hintg.png

...and use <t size='2.5'>Sized text</t> for sized text.

Edited by JW Custom

Share this post


Link to post
Share on other sites

Thanks for the replays. :)

Well so far i use the way JW Custom has explained.

I was just hoping to find a solution to change only one specific line from the "hint format" inside of the syntax without re-writing "parseText" the whole thing.

but looks like i have to re-write the whole "hint" into "parseText" to get it working.

Anyway thanks. :)

Share this post


Link to post
Share on other sites

Hm, you could ab(use) format ;)

_normal = "Normal text";
_str = parseText format ["%1<br/><t color='#f00000ff' size='1.5'>Pretty text</t>"];

hint _str;

Edited by Deadfast

Share this post


Link to post
Share on other sites

Is it possible to use structuredText within cutRsc? I keep banging my head on this whole cutRsc, display and dialog mess, but I'm not sure if my current problems are due to lack of understanding or if it's just not possible.

I scanned the Domination code, which uses a lot of cutRsc, but I only found ctrlSetStructuredText in the spactator script (which is a dialog).

Share this post


Link to post
Share on other sites

Yes, if the resource in question uses a structuredText control.

If I remember correctly my FPS counter does if you want an example.

Share this post


Link to post
Share on other sites

Example would be nice, yes :) Now I've "solved the problem" by adding shadow to the text by creating offset black text underneath the white visible text.

Which reminds me. Something is missing from structured text; outer glow or outline color. Would help separate white text from bright screens.

Share this post


Link to post
Share on other sites

Hi my question would be only on the structured text datatype.

Is there any way to format a structured text with indents or tabulators to make some kind of table layout? The only way i found was currently with putting buch of spaces between columns but it will never align nicely by doing so.

Share this post


Link to post
Share on other sites

Guys here is a hint colour basic script

hintSilent parseText format["<t size='1' font='Zeppelin33' color='#ff0000'>Hello %1!</t>", name player];

hintSilent parseText format["<t size='1' font='Zeppelin33' color='#ff0000'>Write your text here</t>", nothing];

If you want find colour codes

here

http://www.colorpicker.com/

Share this post


Link to post
Share on other sites

Hello,

What if what i needed was multiple different formats in the same hint box, i have seen it before however no idea how to do it

Share this post


Link to post
Share on other sites
On 4/12/2010 at 3:52 PM, SNKMAN said:

Hey guy's,

is it possible to use the "structuredText" within hint format?

Example:

 


_text = parseText ("<t color='#f00000ff' size='1.5'>Nice Text!</t>");

hint format ["%1", _text];
 

 

I know this doesn't work but i'm looking for something like this.

I have a "hint format" with displays the content of several arrays but i need to change the color and size of one line only and the others can use the default color and size.

 

Hey Buddy, I figured out a way to it.

 

/*Hints Text*/
_title  = "<t color='#00ff00' size='2' shadow='1' shadowColor='#000000' align='center'>Kavala Secured</t>";
_text   = "<br /><t color='#0000ff' size='1.4' shadow='1' shadowColor='#000000' align='center'>All enemy units in the area have been eliminated, good job. Await further orders from HQ</t>";
/*End of Hints Text*/

hint parseText (_title+_text);

 

I would give you a screenshot of it working but i am too lazy, just copy this code and you will see it works perfect :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×