From 851898b4aab81c51d5a6b936f4408c9e3696d064 Mon Sep 17 00:00:00 2001 From: candle Date: Sat, 1 Jun 2024 16:19:50 +0100 Subject: [PATCH] midground layer --- docs/event-behaviors.md | 3 +++ src/scripts/playback.js | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/docs/event-behaviors.md b/docs/event-behaviors.md index 1e27069..d3c943c 100644 --- a/docs/event-behaviors.md +++ b/docs/event-behaviors.md @@ -69,15 +69,18 @@ | image layer | meaning |--|-- | background | below the room, events, and dialogue +| midground | above the room, but below the events and dialogue | foreground | above the room and events, but below the dialogue | overlay | above the room, events, and dialogue | name | type | meaning |--|--|-- | background | text | show named image on background layer +| midground | text | show named image on midground layer | foreground | text | show named image on foreground layer | overlay | text | show named image on overlay layer | clear-background | tag | clear image on background layer +| clear-midground | tag | clear image on midground layer | clear-foreground | tag | clear image on foreground layer | clear-overlay | tag | clear image on overlay layer diff --git a/src/scripts/playback.js b/src/scripts/playback.js index 2d7f08f..36f8a44 100644 --- a/src/scripts/playback.js +++ b/src/scripts/playback.js @@ -241,6 +241,13 @@ if (backgrounds.length > 0) { HIDE_IMAGE("BACKGROUND"); } +let midgrounds = FIELDS_OR_LIBRARY("midground"); +if (midgrounds.length > 0) { + SHOW_IMAGE("MIDGROUND", midgrounds, 1, 0, 0); +} else if (IS_TAGGED(EVENT, "clear-midground")) { + HIDE_IMAGE("MIDGROUND"); +} + let foregrounds = FIELDS_OR_LIBRARY("foreground"); if (foregrounds.length > 0) { SHOW_IMAGE("FOREGROUND", foregrounds, 2, 0, 0);