Difference between revisions of "ImagePathFunctions"
From The Battle for Wesnoth Wiki
m |
|||
Line 1: | Line 1: | ||
− | Image Path Functions provide a simple method for WML coders to alter the way their specified images will be displayed in the game. All of the function parameters are included at the end of an image path. | + | Image Path Functions provide a simple method for WML coders to alter the way their specified images will be displayed in the game. All of the function parameters are included at the end of an image path. Currently the only Image Path Function is '''~TC()''', which takes two comma-separated parameters: the team number and the source color range. The valid values for both of these parameters are defined in the file ''data/team-colors.cfg'' |
− | |||
− | Currently the only Image Path Function is '''~TC()''', which takes two comma-separated parameters: the team number and the source color range. The valid values for both of these parameters are defined in the file ''data/team-colors.cfg'' | ||
+ | == Team-Color Function == | ||
+ | '''~TC(''' ''team number'' ''',''' ''source color range'' ''')''' | ||
*''team number'' - this is the first parameter, a number 1-9 signifying the team number of a unit. Number 1 typically means the red team, 2 typically means the blue team, etc. | *''team number'' - this is the first parameter, a number 1-9 signifying the team number of a unit. Number 1 typically means the red team, 2 typically means the blue team, etc. | ||
*''source color range'' - the second parameter is a source color range, usually magenta. Do not surround this parameter with quotes. | *''source color range'' - the second parameter is a source color range, usually magenta. Do not surround this parameter with quotes. |
Revision as of 03:58, 5 September 2006
Image Path Functions provide a simple method for WML coders to alter the way their specified images will be displayed in the game. All of the function parameters are included at the end of an image path. Currently the only Image Path Function is ~TC(), which takes two comma-separated parameters: the team number and the source color range. The valid values for both of these parameters are defined in the file data/team-colors.cfg
Team-Color Function
~TC( team number , source color range )
- team number - this is the first parameter, a number 1-9 signifying the team number of a unit. Number 1 typically means the red team, 2 typically means the blue team, etc.
- source color range - the second parameter is a source color range, usually magenta. Do not surround this parameter with quotes.
In the following example, the elvish captain image is given the team color for team 3, making his magenta regions turn a healthy shade of green:
[message] speaker=narrator image=units/elves-wood/captain.png~TC(3,magenta) message=_ "Now I am on the green team." [/message]