Begin VN scene parser

This commit is contained in:
2023-02-04 23:44:55 -08:00
parent fb34d7c16e
commit 2a67884dde
9 changed files with 255 additions and 44 deletions

View File

@ -0,0 +1,36 @@
<vnscene>
<head>
<!-- Includes -->
<include path="visualnovel/scene/SimpleVNScene.hpp" />
<include path="prefabs/characters/DeathPrefab.hpp" />
<!-- <include scene="Scene_2" /> -->
<!-- Characters -->
<character class="DeathPrefab" name="death" />
<!-- Extra Assets -->
<asset type="AudioAsset" name="audio_test" />
<!-- Scene -->
<scene type="SimpleVNScene" name="Scene_1" />
<!-- Defaults -->
<!-- <default type="animation-curve">out-quad</default> -->
</head>
<!-- Some other ideas I had:
<methods>
<method type="void" name="onSceneEnded">
// Literal CPP code here.
</method>
</methods>
-->
<events>
<pause duration="0.1" />
<text character="death" emotion="happy" string="scene.1.1" />
<character-fade character="death" duration="1.0" ease="out-quad" />
<scene-transition scene="Scene_2" />
</events>
</vnscene>

View File

@ -1,36 +0,0 @@
# This is a sample VN Scene that I am creating to create a scene generator.
# The scene generator will simply create a series of events, nothing more.
# Infact, the scene generator really is just a scene event with trailed events
# Generator.
# Scene name is probably going to be inherited from either the target or the
# filename
# By default the mode we are in is in TEXT mode, unless you explicitly change
# the mode. The text mode takes the person, emotion and text string and tries
# to convert it to this C++ equivallent code;
# new VisualNovelTextboxEvent(vnManager, this->[person]->vnCharacter, this->[person]->[emotion], [text])
# Here is our first example. We take death, give her an emotion, and write some
# text.
death:happy: scene.1.1
# Here, we inherit the existing emotion. I've also omitted the space because it
# is just there for show.
death:scene.1.1
# Now let's fade our character in. Fade char in events start like this
fade death in quad over 1.0
# Could also be written like any of these
# fade death out
# fade death in
# fade death out over 1.0 seconds
# fade death in over 1.0 seconds
# fade death in linear
# fade death out linear over 10 seconds
# fade death out over 10
# Basically the format just needs to be
# fade [character] [in/out] (easing function) (time)
# Each time a fade occurs the parameters will be remembered, and used for any
# other fade after that, so you just need to define the easing curve once per
# scene.