Outils pour utilisateurs

Outils du site


en:yaml:dialogues

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
en:yaml:dialogues [2026/08/30 21:19] – maj 4.14 : dialogues, videos hebergees, mise en page, doc EN completee cyrilfiestaen:yaml:dialogues [2026/10/19 10:46] (Version actuelle) – cyrilfiesta
Ligne 5: Ligne 5:
 A room text can become a **sequence of replies**: the player clicks to move the conversation forward, with a speaker, a portrait, a frame and a background. A room text can become a **sequence of replies**: the player clicks to move the conversation forward, with a speaker, a portrait, a frame and a background.
  
-Everything is optional. A sequence without portrait or background is simply a series of replies shown one after another.+Everything is optional. A sequence without portrait or background is a series of replies shown one after another.
  
 ===== A first sequence ===== ===== A first sequence =====
  
 <code yaml> <code yaml>
-salles:+rooms:
   - id: tavern   - id: tavern
-    texte:+    text:
       type: sequence       type: sequence
       replies:       replies:
Ligne 21: Ligne 21:
 </code> </code>
  
-The player reads the first reply, clicks, then reads the second one. Once the sequence ends, the room shows its choices as usual.+The player reads the first reply, clicks, then reads the second one. By default, the room's choices remain visible during the sequence. To hide the controls until it ends, add ''hide-controls: true'' to the sequence.
  
-Both spellings work: ''replies:'' and ''repliques:'', ''text:'' and ''texte:''.+Use ''replies:'' and ''text:'' in an English scenario. The French aliases ''repliques:'' and ''texte:'' are accepted too. 
 + 
 +===== Reply types ===== 
 + 
 +A reply can specify ''type: dialogue'' (the default), ''narration'', ''thought'', ''system'', ''journal'', ''message'' or ''sent-message''. These types distinguish the presentation of speech, narration, thoughts, notices, journal entries and phone messages. They also work as single blocks outside a sequence. 
 + 
 +In ''ui: phone'' with ''screen: conversation'', ''message'' is a received bubble and ''sent-message'' is a sent bubble. Earlier replies remain visible as conversation history.
  
 ===== Character registry ===== ===== Character registry =====
Ligne 39: Ligne 45:
     portrait-position: right     portrait-position: right
  
-salles:+rooms:
   - id: checkpoint   - id: checkpoint
-    texte:+    text:
       type: sequence       type: sequence
       replies:       replies:
Ligne 69: Ligne 75:
         - text: "Nothing of it is left."         - text: "Nothing of it is left."
 </code> </code>
 +
 +An explicit ''character:'' rebuilds the presentation in this order: scenario defaults > character registry > sequence properties > reply properties. Later values take precedence; local overrides from the previous reply are not automatically carried over. Changing only ''speaker:'' does not remove the portrait: use ''portrait: null'' when needed.
  
 To remove an element explicitly, use ''null''. To remove an element explicitly, use ''null''.
Ligne 103: Ligne 111:
           portrait-overlap: 24           portrait-overlap: 24
 </code> </code>
 +
 +A portrait can also use one cell from a spritesheet: ''portrait: portraits.png:4x2:1:0'' selects column 1, row 0 from a sheet with 4 columns and 2 rows. Coordinates start at **0**, at the top left. Use the image reference directly, without ''%%[[...]]%%''.
 +
 +''portrait-frame:'' adds a frame around the portrait. It accepts the same image or generated frame forms as ''frame:'' (see below):
 +
 +<code yaml>
 +        - character: mara
 +          text: "Come closer."
 +          portrait-frame:
 +            image: /scenarios/images/my-game/frames.png:4x2:1:0
 +            slice: 24
 +            corners: rounded
 +            radius: 12
 +</code>
 +
 +The spritesheet suffix also works for dialogue and speaker frame images. The cell is selected first, then its frame is sliced into nine zones.
  
 ===== Speaker name ===== ===== Speaker name =====
Ligne 128: Ligne 152:
   * ''speaker-frame:'' a frame for the name label itself.   * ''speaker-frame:'' a frame for the name label itself.
  
-With no colour set by the author, the engine picks black or white automatically, based on the background actually displayed, so the name stays readable. A colour written by the author is always kept.+With no color set by the author, the engine picks black or white automatically, based on the background actually displayed, so the name stays readable. A color written by the author is always kept.
  
 ===== Backgrounds ===== ===== Backgrounds =====
Ligne 135: Ligne 159:
  
 <code yaml> <code yaml>
-salles:+rooms:
   - id: laboratory   - id: laboratory
     background-image: /scenarios/images/my-game/lab.png     background-image: /scenarios/images/my-game/lab.png
     background-mode: cover     background-mode: cover
-    texte: "The tanks hum in the half-light."+    text: "The tanks hum in the half-light."
 </code> </code>
  
Ligne 150: Ligne 174:
 | ''cover'' | the image fills the area, cropping the edges if needed | | ''cover'' | the image fills the area, cropping the edges if needed |
 | ''stretch'' | the image is distorted to fit the area exactly | | ''stretch'' | the image is distorted to fit the area exactly |
-| ''center'' | the image keeps its size, centred in the area | +| ''center'' | the image is centred, with its width controlled by ''background-size'' | 
-| ''repeat'' | the pattern is tiled |+| ''tile'' | the pattern is tiled |
  
 Without ''background-mode:'', the whole image is shown while keeping its proportions. An animated image behaves like a still one. Without ''background-mode:'', the whole image is shown while keeping its proportions. An animated image behaves like a still one.
 +
 +With ''background-mode: center'', ''background-size:'' sets the image width as a percentage of the background area (50 by default), keeping its proportions. For example:
 +
 +<code yaml>
 +    background-mode: center
 +    background-size: 70
 +</code>
 +
 +The last background actually displayed by a reply is kept when moving to another room, including another interface mode. A room can change only its mode or size without replacing the image.
  
 ===== Frames ===== ===== Frames =====
Ligne 163: Ligne 196:
 <code yaml> <code yaml>
       frame: /scenarios/images/my-game/frame.png       frame: /scenarios/images/my-game/frame.png
-      slice: 24+      frame-slice: 24
 </code> </code>
  
Ligne 193: Ligne 226:
 </code> </code>
  
-''type:'' is ''character'' (letter by letter) or ''fragment'' (by groups of words). ''speed:'' is the delay in milliseconds.+''type:'' is ''character'' (letter by letter) or ''fragment'' (word by word). ''speed:'' is the delay in milliseconds.
  
 A first click completes the running animation, the next one moves to the following reply. Links, interactive words, buttons and drag and drop **never** advance the sequence by accident: the player can use them freely. A first click completes the running animation, the next one moves to the following reply. Links, interactive words, buttons and drag and drop **never** advance the sequence by accident: the player can use them freely.
Ligne 218: Ligne 251:
 <code yaml> <code yaml>
           transition: fade           transition: fade
 +</code>
 +
 +To set a shared duration, use a block:
 +
 +<code yaml>
 +          transition:
 +            type: fade
 +            duration: 700
 </code> </code>
  
Ligne 227: Ligne 268:
  
 <code yaml> <code yaml>
-    texte:+    text:
       type: sequence       type: sequence
       hide-controls: true       hide-controls: true
Ligne 236: Ligne 277:
 ===== Mixing text and sequences ===== ===== Mixing text and sequences =====
  
-A ''texte:'' field accepts a list: plain texts and sequences follow one another in the order written.+A ''text:'' field accepts a list: plain texts and sequences follow one another in the order written.
  
 <code yaml> <code yaml>
-    texte:+    text:
       - "You push the office door open."       - "You push the office door open."
       - type: sequence       - type: sequence
Ligne 259: Ligne 300:
 </code> </code>
  
-The French form is ''%%[[SALLE:n]]%%''. Circular references are detected and stopped.+The French form is ''%%[[SALLE:n]]%%''. Circular references are detected and stopped. Inside an existing reply, an inserted sequence is flattened into text; it does not create a nested clickable sequence.
  
 ===== On other platforms ===== ===== On other platforms =====
en/yaml/dialogues.1788117593.txt.gz · Dernière modification : de cyrilfiesta