Starting new VN Structure
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user