Starting new VN Structure

This commit is contained in:
2023-04-18 09:55:11 -07:00
parent 26efdfe314
commit 1c21c15261
77 changed files with 929 additions and 27 deletions

View File

@ -0,0 +1,28 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "VisualNovelFadeCharacterEvent.hpp"
using namespace Dawn;
VisualNovelFadeCharacterEvent::VisualNovelFadeCharacterEvent(
VisualNovelManager *man,
VisualNovelCharacter *character,
bool_t fadeIn,
easefunction_t *ease,
float_t duration
) : VisualNovelSimpleAnimationEvent<float_t>(
man,
&character->material->color.a
) {
this->simpleAnimation.easing = ease;
if(fadeIn) {
this->simpleAnimation.addKeyframe(0.0f, 0.0f);
this->simpleAnimation.addKeyframe(duration, 1.0f);
} else {
this->simpleAnimation.addKeyframe(0.0f, 1.0f);
this->simpleAnimation.addKeyframe(duration, 0.0f);
}
}