Difference between revisions of "DescriptionWML"
From The Battle for Wesnoth Wiki
m (→See Also: Added Category WML) |
|||
Line 3: | Line 3: | ||
A description is a part of the value of a menu attribute. | A description is a part of the value of a menu attribute. | ||
− | It is used to represent a single option in the menu which consists of an image(called the ''icon'') followed by text. | + | It is used to represent a single option in the menu which consists of an image(called the ''icon'') followed by text. When appropriate, the icon should use [[ImagePathFunctionWML]] to replace any magenta with a team color. |
A description has the format | A description has the format | ||
Line 19: | Line 19: | ||
for example: | for example: | ||
− | difficulty_descriptions="&" + "elvish-fighter.png" + "=" + _"Fighter" + "=" + _"(easiest)" + | + | difficulty_descriptions="&" + "units/elves-wood/elvish-fighter.png~TC(1,magenta)" + "=" + _"Fighter" + "=" + _"(easiest)" + |
− | ";*" + "&" + "elvish-hero.png" + "=" + _"Hero" + | + | ";*" + "&" + "units/elves-wood/elvish-hero.png~TC(1,magenta)" + "=" + _"Hero" + |
− | ";" + "&" + "elvish-champion.png" + "=" + _"Champion" + "=" + _"(hardest)" | + | ";" + "&" + "units/elves-wood/elvish-champion.png~TC(1,magenta)" + "=" + _"Champion" + "=" + _"(hardest)" |
The utility macros (see [[UtilWML]]) '''{MENU_IMG_TXT ''icon'' ''text''}''' | The utility macros (see [[UtilWML]]) '''{MENU_IMG_TXT ''icon'' ''text''}''' | ||
Line 27: | Line 27: | ||
can be used to create descriptions more easily. The above example would become: | can be used to create descriptions more easily. The above example would become: | ||
− | difficulty_descriptions={MENU_IMG_TXT2 "elvish-fighter.png" _"Fighter" _"(easiest)"} + | + | difficulty_descriptions={MENU_IMG_TXT2 "units/elves-wood/elvish-fighter.png~TC(1,magenta)" _"Fighter" _"(easiest)"} + |
− | ";*" + {MENU_IMG_TXT "elvish-hero.png" _"Hero"} + ";" + | + | ";*" + {MENU_IMG_TXT "units/elves-wood/elvish-hero.png~TC(1,magenta)" _"Hero"} + ";" + |
− | {MENU_IMG_TXT2 "elvish-champion.png" _"Champion" _"(hardest)"} | + | {MENU_IMG_TXT2 "units/elves-wood/elvish-champion.png~TC(1,magenta)" _"Champion" _"(hardest)"} |
== See Also == | == See Also == |
Revision as of 04:21, 5 September 2006
Description texts
A description is a part of the value of a menu attribute. It is used to represent a single option in the menu which consists of an image(called the icon) followed by text. When appropriate, the icon should use ImagePathFunctionWML to replace any magenta with a team color.
A description has the format
- ; if another description precedes it
- * if it should be the default selection
- &image=text image with text description
- &image=text=text2 image with two text descriptions
Single text items are always enclosed in ", and concatenated with +. This is useful so the text can contain translateable items (the _ before a text), and so it can span multiple lines.
for example:
difficulty_descriptions="&" + "units/elves-wood/elvish-fighter.png~TC(1,magenta)" + "=" + _"Fighter" + "=" + _"(easiest)" + ";*" + "&" + "units/elves-wood/elvish-hero.png~TC(1,magenta)" + "=" + _"Hero" + ";" + "&" + "units/elves-wood/elvish-champion.png~TC(1,magenta)" + "=" + _"Champion" + "=" + _"(hardest)"
The utility macros (see UtilWML) {MENU_IMG_TXT icon text} and {MENU_IMG_TXT2 icon text text-2} can be used to create descriptions more easily. The above example would become:
difficulty_descriptions={MENU_IMG_TXT2 "units/elves-wood/elvish-fighter.png~TC(1,magenta)" _"Fighter" _"(easiest)"} + ";*" + {MENU_IMG_TXT "units/elves-wood/elvish-hero.png~TC(1,magenta)" _"Hero"} + ";" + {MENU_IMG_TXT2 "units/elves-wood/elvish-champion.png~TC(1,magenta)" _"Champion" _"(hardest)"}