Difference between revisions of "IntroWML"
(→The [story] tag: background_overlay -> background_layer (? Not sure, but at least it makes sense)) |
(linkies) |
||
(13 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{WML Tags}} | {{WML Tags}} | ||
− | |||
− | The '''[story]''' tag is a series of images and text to display as the first part of the intro screen. | + | The '''[story]''' tag is a series of images and text to display as the first part of the intro screen. It can appear in [[ScenarioWML]] or {{DevFeature1.13|8}} as [[InterfaceActionsWML#.5Bstory.5D|ActionWML]]. |
− | '''[ | + | The [[InterfaceActionsWML#.5Bdeprecated_message.5D|'''[deprecated_message]''']], [[InterfaceActionsWML#.5Bwml_message.5D|'''[wml_message]''']], and [[VariablesWML#.5Binsert_tag.5D|'''[insert_tag]''']] tags are allowed beneath '''[story]'''. Most other WML tags will not be recognized in this context. Note, however, that messages produced by the first two tags will not appear in the game interface until the actual game map appears. |
− | The part | + | |
+ | The only other tags currently recognized within '''[story]''' and '''[part]''' are [[ConditionalActionsWML#.5Bif.5D|'''[if]'''/'''[then]'''/'''[else]''']] ({{DevFeature1.13|0}}: also [[ConditionalActionsWML#.5Bif.5D|'''[elseif]''']]) and [[ConditionalActionsWML#.5Bswitch.5D|'''[switch]'''/'''[case]''']]. These can be used to show parts conditionally on the values of variables. | ||
+ | |||
+ | See also the journey and battle macros, in the [https://www.wesnoth.org/macro-reference.html#file:image-utils.cfg Macro Reference] | ||
+ | |||
+ | == [part] == | ||
+ | |||
+ | Each '''[part]''' tag represents one "page" of a story sequence, with its own text and images. The player advances through parts by clicking on the '''Next'''/'''→''' button to advance one part, the '''Back'''/'''←''' button to go back one part, and the '''Skip''' button to leave the story sequence and start/return to the game. | ||
+ | |||
+ | The following keys/tags are recognized for '''[part]'''. | ||
+ | |||
+ | === Main text keys === | ||
− | |||
− | |||
− | |||
* '''story''': (translatable) the text to display below the image. | * '''story''': (translatable) the text to display below the image. | ||
+ | * '''text_alignment''': specifies the alignment of the story text. It must be one of ''left'' (default), ''center'' or ''right''. | ||
+ | * '''text_layout''': specifies the vertical portion of the screen where the story text will be displayed. It must be one of ''top'', ''middle'' or ''bottom'' (default). | ||
+ | |||
+ | === Title text keys === | ||
+ | |||
* '''show_title''': whether to display the title of the scenario at the top | * '''show_title''': whether to display the title of the scenario at the top | ||
− | * '''title''': specifies a custom title to display instead of the name of the scenario. If specified, it implies '''show_title=yes'''. | + | * '''title''': specifies a custom title to display instead of the name of the scenario. If specified, it implies '''show_title=yes'''. If parent the '''[story]''' is used through [[InterfaceActionsWML#.5Bstory.5D|ActionWML]] with '''show_title=yes''', the '''title''' key must be explicitly specified as it does not default to the scenario title and leads to a missing title error if omitted. |
+ | * '''title_alignment''': specifies the alignment of the title box. It must be one of ''left'' (default), ''center'' or ''right''. | ||
+ | |||
+ | === Image and sound keys === | ||
+ | |||
+ | * '''background''': the image to display. Story images are usually created specially for this purpose, except for the map. | ||
+ | * '''scale_background''': Whether to scale the background, default yes. | ||
* '''music''': change to this music | * '''music''': change to this music | ||
* '''sound''': a list of sound files; the engine will choose one at random and play it once while displaying the story part. | * '''sound''': a list of sound files; the engine will choose one at random and play it once while displaying the story part. | ||
− | * ''' | + | * '''voice''': a list of sound files; the engine will choose one at random and play it on a sound channel intended for voice overs once while displaying the story part. |
− | + | ||
− | + | === [background_layer] === | |
− | + | ||
− | + | A layer of the background of the story screen. | |
− | + | ||
− | + | * '''image''': path to the image file. | |
− | + | * '''scale_vertically''': whether the image should be scaled to fill the screen in the vertical dimension. Default yes. | |
− | + | * '''scale_horizontally''': whether the image should be scaled to fill the screen in the horizontal dimension. Default yes. | |
− | + | * '''scale''': a shortcut to set scale_vertically and scale_horizontally at once. If specified, the values of the former two keys will be ignored. | |
− | + | * '''keep_aspect_ratio''': whether the aspect ratio of the image should be preserved while scaling. Default yes. | |
− | + | * '''tile_vertically''': whether the image should be tiled in the vertical direction. Tiling happens after aligning the image to the center of the screen. Default no. | |
− | + | * '''tile_horizontally''': whether the image should be tiled in the horizontal direction. Tiling happens after aligning the image to the center of the screen. Default no. | |
− | + | * '''tile''': a shortcut to set tile_vertically and tile_horizontally at once. If specified, the values of the former two keys will be ignored. | |
− | + | * '''base_layer''': whether is this the layer to align the overlay images to. Default no. | |
− | + | ||
− | + | === [image] === | |
− | + | An image to display. | |
− | + | * '''x''', '''y''': the location to draw the image, using the pixels of the '''base_layer''' background image as the coordinate system. | |
+ | * '''centered''': If "yes", use the center of the image as the anchor point when placing at the x,y coordinates, if "no" then use the top-left corner. | ||
+ | * '''file''': the image to display. | ||
+ | * '''delay''': the time to delay drawing this image. | ||
+ | * '''resize_with_background''': {{DevFeature1.15|7}} if "yes", apply the same scaling as applied to the '''base_layer''' | ||
− | + | Each image is placed using the pixels of the background_layer as the coordinate system; each image's location moves to compensate when the background image is scaled. Example: my background image is a map with a city at pixel 160,100; I put a battle marker on that city using '''x,y,centered=160,100,yes'''. When a user plays the game they will see the map enlarged to fill the window (regardless of its size), and the battle marker will still be on top of the city. | |
== See Also == | == See Also == |
Latest revision as of 04:37, 6 March 2024
The [story] tag is a series of images and text to display as the first part of the intro screen. It can appear in ScenarioWML or (Version 1.13.8 and later only) as ActionWML.
The [deprecated_message], [wml_message], and [insert_tag] tags are allowed beneath [story]. Most other WML tags will not be recognized in this context. Note, however, that messages produced by the first two tags will not appear in the game interface until the actual game map appears.
The only other tags currently recognized within [story] and [part] are [if]/[then]/[else] ((Version 1.13.0 and later only): also [elseif]) and [switch]/[case]. These can be used to show parts conditionally on the values of variables.
See also the journey and battle macros, in the Macro Reference
Contents
[part]
Each [part] tag represents one "page" of a story sequence, with its own text and images. The player advances through parts by clicking on the Next/→ button to advance one part, the Back/← button to go back one part, and the Skip button to leave the story sequence and start/return to the game.
The following keys/tags are recognized for [part].
Main text keys
- story: (translatable) the text to display below the image.
- text_alignment: specifies the alignment of the story text. It must be one of left (default), center or right.
- text_layout: specifies the vertical portion of the screen where the story text will be displayed. It must be one of top, middle or bottom (default).
Title text keys
- show_title: whether to display the title of the scenario at the top
- title: specifies a custom title to display instead of the name of the scenario. If specified, it implies show_title=yes. If parent the [story] is used through ActionWML with show_title=yes, the title key must be explicitly specified as it does not default to the scenario title and leads to a missing title error if omitted.
- title_alignment: specifies the alignment of the title box. It must be one of left (default), center or right.
Image and sound keys
- background: the image to display. Story images are usually created specially for this purpose, except for the map.
- scale_background: Whether to scale the background, default yes.
- music: change to this music
- sound: a list of sound files; the engine will choose one at random and play it once while displaying the story part.
- voice: a list of sound files; the engine will choose one at random and play it on a sound channel intended for voice overs once while displaying the story part.
[background_layer]
A layer of the background of the story screen.
- image: path to the image file.
- scale_vertically: whether the image should be scaled to fill the screen in the vertical dimension. Default yes.
- scale_horizontally: whether the image should be scaled to fill the screen in the horizontal dimension. Default yes.
- scale: a shortcut to set scale_vertically and scale_horizontally at once. If specified, the values of the former two keys will be ignored.
- keep_aspect_ratio: whether the aspect ratio of the image should be preserved while scaling. Default yes.
- tile_vertically: whether the image should be tiled in the vertical direction. Tiling happens after aligning the image to the center of the screen. Default no.
- tile_horizontally: whether the image should be tiled in the horizontal direction. Tiling happens after aligning the image to the center of the screen. Default no.
- tile: a shortcut to set tile_vertically and tile_horizontally at once. If specified, the values of the former two keys will be ignored.
- base_layer: whether is this the layer to align the overlay images to. Default no.
[image]
An image to display.
- x, y: the location to draw the image, using the pixels of the base_layer background image as the coordinate system.
- centered: If "yes", use the center of the image as the anchor point when placing at the x,y coordinates, if "no" then use the top-left corner.
- file: the image to display.
- delay: the time to delay drawing this image.
- resize_with_background: (Version 1.15.7 and later only) if "yes", apply the same scaling as applied to the base_layer
Each image is placed using the pixels of the background_layer as the coordinate system; each image's location moves to compensate when the background image is scaled. Example: my background image is a map with a city at pixel 160,100; I put a battle marker on that city using x,y,centered=160,100,yes. When a user plays the game they will see the map enlarged to fill the window (regardless of its size), and the battle marker will still be on top of the city.