Magic_Game/core/Transition/EmergeTransition.cpp

32 lines
519 B
C++
Raw Normal View History

2018-04-21 21:24:46 +08:00
#include "..\e2dtransition.h"
#include "..\e2dnode.h"
2017-10-21 19:09:31 +08:00
2018-08-14 00:26:20 +08:00
e2d::EmergeTransition::EmergeTransition(Scene* scene, float duration)
: Transition(scene, duration)
2017-10-21 19:09:31 +08:00
{
}
2018-08-14 00:26:20 +08:00
bool e2d::EmergeTransition::_init(Scene * prev)
2018-04-17 11:41:33 +08:00
{
2018-08-14 00:26:20 +08:00
if (Transition::_init(prev))
2018-08-02 00:27:45 +08:00
{
_outLayerParam.opacity = 1;
_inLayerParam.opacity = 0;
return true;
}
return false;
2018-04-17 11:41:33 +08:00
}
2018-08-14 00:26:20 +08:00
void e2d::EmergeTransition::_update()
2017-10-21 19:09:31 +08:00
{
2018-08-14 00:26:20 +08:00
Transition::_update();
2018-08-02 00:27:45 +08:00
2018-07-28 20:06:27 +08:00
_outLayerParam.opacity = 1 - _delta;
_inLayerParam.opacity = _delta;
2017-10-21 19:09:31 +08:00
if (_delta >= 1)
2018-01-30 16:45:38 +08:00
{
2018-08-14 00:26:20 +08:00
this->_stop();
}
}