changing text colour in dynamic templates

guzmere
10 Jun 2013, 20:54Hi hope someone can help, I am trying to change the font colour in a dynamic template. It is default climb and I have tried using
[<font color = "black">".....I can't climb that!"</font color>] ------but I get this error
Error running script: Error evaluating expression 'DynamicTemplate(this.defaulttemplate, object)': Error compiling expression '<font color = "black">".....I can't climb that!"</font color>': SyntaxError: Unexpected token "<"; expected one of "NOT", "-", <INTEGER>, <REAL>, <STRING_LITERAL>, "True", "False", <HEX_LITERAL>, <CHAR_LITERAL>, "null", <DATETIME>, <TIMESPAN>, "(", <IDENTIFIER>, "if", or "cast"Line: 1, Column: 1
I have the used syntax in the ordinary templates and they work great. The reason I am doing this is so I have one colour on the typed words and another on the answer words. Hope you can understand that thanks Terry
Happy Adventuring 
[<font color = "black">".....I can't climb that!"</font color>] ------but I get this error
Error running script: Error evaluating expression 'DynamicTemplate(this.defaulttemplate, object)': Error compiling expression '<font color = "black">".....I can't climb that!"</font color>': SyntaxError: Unexpected token "<"; expected one of "NOT", "-", <INTEGER>, <REAL>, <STRING_LITERAL>, "True", "False", <HEX_LITERAL>, <CHAR_LITERAL>, "null", <DATETIME>, <TIMESPAN>, "(", <IDENTIFIER>, "if", or "cast"Line: 1, Column: 1
I have the used syntax in the ordinary templates and they work great. The reason I am doing this is so I have one colour on the typed words and another on the answer words. Hope you can understand that thanks Terry



jaynabonne
10 Jun 2013, 22:05I'd put the tags inside the quotes with the text. And use single quotes around the color to make it work inside the string. \also note that "color" is an attribute of the font tag; it's not part of the element name.
["<font color = 'black'>.....I can't climb that!</font>"]

guzmere
11 Jun 2013, 06:14Hi Jay you are a life saver thanks a million. By the way I'm sorry for being thick but how do you mean
(that "color" is an attribute of the font tag; it's not part of the element name.) I'm not clear on that?
but
Happy adventuring
P. S. What happened to the testing of the new game between you and Sgreig? Haven't heard anymore. Terry




P. S. What happened to the testing of the new game between you and Sgreig? Haven't heard anymore. Terry
Liam315
11 Jun 2013, 07:24In the original post you wrote that you closed the tag with </font color>, but "color" shouldn't be written in the closing tag as it is just one of the options you can select within the <font> tag. i.e. it's an attribute of the font tag, not a distinct tag itself.

guzmere
11 Jun 2013, 09:39Liam thanks for that will get rid of color, but I'm still not clear about the rest, sorry told you I was thick didn't I. Terry
Oh well
Happy Adventuring 




jaynabonne
11 Jun 2013, 10:30The tag you are using is a font tag. So it generally looks like this:
You can apply attributes to that tag. One of them is "color". Another is "size". You'd add an attribute like this:
Note that the color="red" part does not change the overall fact that you are still within a "font" tag. You don't add "color" to the close - it's still just "font".
You could add even more:
(Regarding your question about the game with Scott, I don't know. I thought he was going to hand it out.)
<font>some text here</font>
You can apply attributes to that tag. One of them is "color". Another is "size". You'd add an attribute like this:
<font color="red">some text here</font>
Note that the color="red" part does not change the overall fact that you are still within a "font" tag. You don't add "color" to the close - it's still just "font".
You could add even more:
<font color="red" size="2" face="verdana">some text here</font>
(Regarding your question about the game with Scott, I don't know. I thought he was going to hand it out.)

guzmere
11 Jun 2013, 17:25!Eureka!
Thanks a million Jay I understand that now thanks for being patient. Terry
Happy Adventuring 
Thanks a million Jay I understand that now thanks for being patient. Terry

