-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: video portraits, hidden portraits, custom size portraits (#133)
* feat: adding video portraits support and also hidden portraits * feat: video portraits, hidden portraits, custom size portraits
- Loading branch information
Showing
11 changed files
with
295 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
title: Characters and portraits | ||
description: This page explains how to add or edit characters in the characters.yaml file | ||
--- | ||
|
||
# Characters and portraits | ||
|
||
## characters.yaml | ||
|
||
The `characters.yaml` file contains the config for all characters that can speak in the game. They should all at least have a name value, and a list of different sprite variants . The sprite is used for displaying character portraits during dialogue | ||
|
||
When using a talk command like `talk player idle "Hello!"`, the engine will look for a character with the name `player` in the `characters.yaml` file, and display the `idle` sprite variant of that character. | ||
|
||
::: danger | ||
Do not delete the default game and player characters. | ||
|
||
The `game` character is the placeholder one used for empty text commands. | ||
The `player` character is the one used for the text when the player makes choices. | ||
|
||
You can change which character is used as the default with the `playerCharacter` and `gameCharacter` options as seen below. | ||
::: | ||
|
||
## Example characters config | ||
|
||
```yaml | ||
--- | ||
config: | ||
imagesPath: img/characters/ | ||
playerCharacter: player | ||
gameCharacter: game | ||
characters: | ||
game: | ||
name: '' | ||
color: white | ||
player: | ||
style: | ||
color: orange | ||
sprites: | ||
idle: player.webp | ||
name: You | ||
player2: | ||
style: | ||
color: green | ||
sprites: | ||
idle: player.webp | ||
name: Player 2 | ||
``` | ||
## Video Characters | ||
Characters can have a video instead of an image to display animated characters. For example: | ||
```yaml | ||
characters: | ||
helper: | ||
sprites: | ||
idle: | ||
image: helper_cat.webp | ||
videoPose: | ||
video: helper_video.mp4 | ||
width: 200 | ||
height: 355 | ||
style: | ||
color: green | ||
name: Helper Cat | ||
``` | ||
Then using `talk helper videoPose "Hello!"` will play the video inside the portrait window. | ||
|
||
## Hidden characters | ||
|
||
If you want the portrait for a character to _not_ appear, you can set the value of a specific sprite to `"none"`: | ||
|
||
```yaml | ||
characters: | ||
player: | ||
style: | ||
color: orange | ||
sprites: | ||
idle: none | ||
name: You | ||
``` | ||
|
||
Then using `talk player idle "Hello"` will make the player's name appear as the speaker, but no portrait window will be shown. | ||
|
||
## Available options | ||
|
||
The color character names appears as can be changed with the `color` value in the `style` property of the character (the value can be any valid CSS color). | ||
|
||
A character's config can have the following values: | ||
|
||
- `name`: The name the character will appear as | ||
- `sprites`: A key-value object of pose names to the url of the picture to use for that pose. Poses are used with the talk command (the command `talk player idle "A sentence"` would use the character "player" with the picture for the pose named "idle") | ||
- `style`: An object to customise how that character looks with the following options: | ||
- color: a CSS color (ie. "red", or #FFF) | ||
- boxCss: [CSS style object](https://www.w3schools.com/jsref/dom_obj_style.asp) for custom-styling of the box encapsulating a dialogue from that character. | ||
- nameCss: Same as above, but the styling will apply to the name of the character specifically | ||
- textCss: Same as above, but will apply to the text "spoken" by the character |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.