2018-05-22 13:49:10 +08:00
|
|
|
#include "..\e2dtransition.h"
|
|
|
|
|
#include "..\e2dnode.h"
|
|
|
|
|
|
2018-07-28 20:06:27 +08:00
|
|
|
e2d::BoxTransition::BoxTransition(float duration)
|
2018-05-22 13:49:10 +08:00
|
|
|
: Transition(duration)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-22 22:29:42 +08:00
|
|
|
void e2d::BoxTransition::_init(Scene * prev, Scene * next)
|
2018-05-22 13:49:10 +08:00
|
|
|
{
|
|
|
|
|
Transition::_init(prev, next);
|
|
|
|
|
_inLayerParam.opacity = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-22 22:29:42 +08:00
|
|
|
void e2d::BoxTransition::_updateCustom()
|
2018-05-22 13:49:10 +08:00
|
|
|
{
|
|
|
|
|
if (_delta <= 0.5)
|
|
|
|
|
{
|
|
|
|
|
_outLayerParam.contentBounds = D2D1::RectF(
|
2018-07-28 20:06:27 +08:00
|
|
|
_windowSize.width * _delta,
|
|
|
|
|
_windowSize.height * _delta,
|
|
|
|
|
_windowSize.width * (1 - _delta),
|
|
|
|
|
_windowSize.height * (1 - _delta)
|
2018-05-22 13:49:10 +08:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_outLayerParam.opacity = 0;
|
|
|
|
|
_inLayerParam.opacity = 1;
|
|
|
|
|
_inLayerParam.contentBounds = D2D1::RectF(
|
2018-07-28 20:06:27 +08:00
|
|
|
_windowSize.width * (1 - _delta),
|
|
|
|
|
_windowSize.height * (1 - _delta),
|
|
|
|
|
_windowSize.width * _delta,
|
|
|
|
|
_windowSize.height * _delta
|
2018-05-22 13:49:10 +08:00
|
|
|
);
|
|
|
|
|
if (_delta >= 1)
|
|
|
|
|
{
|
|
|
|
|
this->_stop();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-22 22:29:42 +08:00
|
|
|
void e2d::BoxTransition::_reset()
|
2018-05-22 13:49:10 +08:00
|
|
|
{
|
|
|
|
|
}
|