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 and should not contain any spaces or special characters. Currently the only Image Path Function is '''~TC()''', which takes two comma-separated parameters: the team number and the source color | + | 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 and should not contain any spaces or special characters. Currently the only Image Path Function is '''~TC()''', which takes two comma-separated parameters: the team number and the source color palette. The valid values for both of these parameters are defined in the file ''data/team-colors.cfg'' |
== Team-Color Function == | == Team-Color Function == | ||
− | '''~TC(''' ''team number'' ''',''' ''source color | + | '''~TC(''' ''team number'' ''',''' ''source color palette'' ''')''' |
*''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 | + | *''source color palette'' - the second parameter is a source color palette, 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: | 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: |
Revision as of 06:17, 17 November 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 and should not contain any spaces or special characters. Currently the only Image Path Function is ~TC(), which takes two comma-separated parameters: the team number and the source color palette. 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 palette )
- 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 palette - the second parameter is a source color palette, 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]