Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/Concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ const presentationState = constructPresentationState(presentations);

Presentation state includes:

- `base`: Base layout/screen configuration
- `background`: Current background or CG
- `dialogue`: Speaker, text content, mode (ADV/NVL)
- `character`: Character sprites and positions
Expand Down
1 change: 0 additions & 1 deletion docs/RouteEngine.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ Actions that can be attached to lines to control presentation:

| Action | Properties | Description |
| ------------ | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `base` | `{ resourceId }` | Set base layout |
| `background` | `{ resourceId, animations? }` | Set background/CG |
| `dialogue` | `{ characterId?, character?, content, mode?, ui?, clear? }` | Display dialogue |
| `character` | `{ items }` | Display character sprites. Each item can have optional `x` and `y` to override transform position |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "route-engine-js",
"version": "0.3.0",
"version": "0.3.1",
"description": "A lightweight Visual Novel engine built in JavaScript for creating interactive narrative games with branching storylines",
"repository": {
"type": "git",
Expand Down
24 changes: 8 additions & 16 deletions spec/system/constructPresentationState.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ suites: [constructPresentationState]
suite: constructPresentationState
exportName: constructPresentationState
---
case: construct presentation state with single base action
case: construct presentation state with single background action
in:
- - base:
resourceId: "mainBase"
- - background:
resourceId: "mainBackground"
out:
base:
resourceId: "mainBase"
background:
resourceId: "mainBackground"
---
case: construct presentation state with control action
in:
Expand Down Expand Up @@ -39,16 +39,12 @@ out:
---
case: construct presentation state with multiple actions in one presentation
in:
- - base:
resourceId: "mainBase"
background:
- - background:
resourceId: "bgImage"
bgm:
resourceId: "backgroundMusic"
loop: true
out:
base:
resourceId: "mainBase"
background:
resourceId: "bgImage"
bgm:
Expand All @@ -58,15 +54,11 @@ out:
case: construct presentation state with clean all and multiple presentations
in:
- - cleanAll: true
base:
resourceId: "oldBase"
- base:
resourceId: "newBase"
background:
resourceId: "oldBg"
- background:
resourceId: "newBg"
out:
base:
resourceId: "newBase"
background:
resourceId: "newBg"
---
Expand Down
82 changes: 47 additions & 35 deletions spec/system/constructRenderState.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,70 +5,94 @@ suites: [constructRenderState]
suite: constructRenderState
exportName: constructRenderState
---
case: construct render state with single base action
case: construct render state with single background layout action
in:
- - presentationState:
base:
resourceId: "mainBase"
background:
resourceId: "mainBackground"
resources:
layouts:
mainBase:
mainBackground:
elements:
- type: "container"
id: "base-container"
id: "background-container"
out:
elements:
- id: "story"
type: "container"
x: 0
y: 0
children:
- id: "base"
- id: "bg-cg-mainBackground"
type: "container"
children:
- type: "container"
id: "base-container"
id: "background-container"
animations: []
audio: []
global: {}
---
case: construct render state with multiple actions in one presentation
case: construct render state keeps controls behind background and layout
in:
- - presentationState:
base:
resourceId: "mainBase"
control:
resourceId: "gameplay"
background:
resourceId: "bgImage"
layout:
resourceId: "foregroundLayout"
resources:
layouts:
mainBase:
elements:
- type: "container"
id: "base-container"
images:
bgImage:
fileId: "background.jpg"
width: 1920
height: 1080
controls:
gameplay:
elements:
- id: "control-hitbox"
type: "rect"
x: 0
y: 0
width: 100
height: 100
layouts:
foregroundLayout:
elements:
- type: "container"
id: "foreground-container"
out:
elements:
- id: "story"
type: "container"
x: 0
y: 0
children:
- id: "base"
- id: "control-gameplay"
type: "container"
x: 0
y: 0
children:
- type: "container"
id: "base-container"
- id: "control-hitbox"
type: "rect"
x: 0
y: 0
width: 100
height: 100
- id: "bg-cg-bgImage"
type: "sprite"
x: 0
y: 0
src: "background.jpg"
width: 1920
height: 1080
- id: "layout-foregroundLayout"
type: "container"
x: 0
y: 0
children:
- type: "container"
id: "foreground-container"
animations: []
audio: []
global: {}
Expand All @@ -77,25 +101,18 @@ case: construct render state with clean all and multiple presentations
in:
- - presentationState:
cleanAll: true
base:
resourceId: "oldBase"
background:
resourceId: "oldBg"
resources:
layouts:
oldBase:
oldBg:
elements:
- type: "container"
id: "old-container"
- presentationState:
base:
resourceId: "newBase"
background:
resourceId: "newBg"
resources:
layouts:
newBase:
elements:
- type: "container"
id: "new-container"
images:
newBg:
fileId: "new-background.jpg"
Expand All @@ -108,12 +125,7 @@ out:
x: 0
y: 0
children:
- id: "base"
type: "container"
children:
- type: "container"
id: "new-container"
- id: "base"
- id: "bg-cg-oldBg"
type: "container"
children:
- type: "container"
Expand All @@ -127,4 +139,4 @@ out:
height: 1080
animations: []
audio: []
global: {}
global: {}
Loading
Loading