36 lines
931 B
C++
36 lines
931 B
C++
|
|
#include "..\etransitions.h"
|
|||
|
|
#include "..\eactions.h"
|
|||
|
|
|
|||
|
|
e2d::ETransitionFade::ETransitionFade(float fadeOutDuration, float fadeInDuration)
|
|||
|
|
: m_fFadeOutDuration(fadeOutDuration)
|
|||
|
|
, m_fFadeInDuration(fadeInDuration)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void e2d::ETransitionFade::_setTarget(EScene * prev, EScene * next, bool & enterNextScene, bool & transitional)
|
|||
|
|
{
|
|||
|
|
// <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
auto action1 = new EActionFadeOut(m_fFadeOutDuration);
|
|||
|
|
if (prev)
|
|||
|
|
{
|
|||
|
|
action1->setTarget(prev->getRoot());
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20>л<EFBFBD><D0BB><EFBFBD><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ 0
|
|||
|
|
auto action2 = new EActionCallback([&, next] {
|
|||
|
|
enterNextScene = true;
|
|||
|
|
next->getRoot()->setOpacity(0);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
// <20>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
auto action3 = new EActionFadeIn(m_fFadeInDuration);
|
|||
|
|
action3->setTarget(next->getRoot());
|
|||
|
|
|
|||
|
|
// <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
auto action4 = new EActionCallback([&] {
|
|||
|
|
transitional = false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
EActionManager::addAction(new EActionSequence(4, action1, action2, action3, action4));
|
|||
|
|
}
|