2018-04-21 21:24:46 +08:00
|
|
|
#include "..\e2dtransition.h"
|
|
|
|
|
#include "..\e2dnode.h"
|
2017-10-21 19:09:31 +08:00
|
|
|
|
2018-07-28 20:06:27 +08:00
|
|
|
e2d::EmergeTransition::EmergeTransition(float duration)
|
2018-05-09 00:34:15 +08:00
|
|
|
: Transition(duration)
|
2017-10-21 19:09:31 +08:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-02 00:27:45 +08:00
|
|
|
bool e2d::EmergeTransition::init(Scene * prev, Scene * next)
|
2018-04-17 11:41:33 +08:00
|
|
|
{
|
2018-08-02 00:27:45 +08:00
|
|
|
if (Transition::init(prev, next))
|
|
|
|
|
{
|
|
|
|
|
_outLayerParam.opacity = 1;
|
|
|
|
|
_inLayerParam.opacity = 0;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
2018-04-17 11:41:33 +08:00
|
|
|
}
|
|
|
|
|
|
2018-08-02 00:27:45 +08:00
|
|
|
void e2d::EmergeTransition::update()
|
2017-10-21 19:09:31 +08:00
|
|
|
{
|
2018-08-02 00:27:45 +08:00
|
|
|
Transition::update();
|
|
|
|
|
|
2018-07-28 20:06:27 +08:00
|
|
|
_outLayerParam.opacity = 1 - _delta;
|
|
|
|
|
_inLayerParam.opacity = _delta;
|
2017-10-21 19:09:31 +08:00
|
|
|
|
2018-05-08 20:03:29 +08:00
|
|
|
if (_delta >= 1)
|
2018-01-30 16:45:38 +08:00
|
|
|
{
|
2018-08-02 00:27:45 +08:00
|
|
|
this->stop();
|
2017-12-09 15:27:11 +08:00
|
|
|
}
|
|
|
|
|
}
|
2017-10-21 19:09:31 +08:00
|
|
|
|
2018-08-02 00:27:45 +08:00
|
|
|
void e2d::EmergeTransition::reset()
|
2017-12-09 15:27:11 +08:00
|
|
|
{
|
2017-10-21 19:09:31 +08:00
|
|
|
}
|