2020-08-04 13:15:02 +08:00
|
|
|
#include "Window2.h"
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
USING_NS_AX;
|
2020-08-04 13:15:02 +08:00
|
|
|
|
|
|
|
void Window2::onInit()
|
|
|
|
{
|
|
|
|
setContentPane(UIPackage::createObject("Basics", "WindowB")->as<GComponent>());
|
|
|
|
center();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Window2::doShowAnimation()
|
|
|
|
{
|
|
|
|
setScale(0.1f, 0.1f);
|
|
|
|
setPivot(0.5f, 0.5f);
|
|
|
|
|
2022-07-16 10:43:05 +08:00
|
|
|
GTween::to(getScale(), Vec2::ONE, 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(Window2::onShown, this));
|
2020-08-04 13:15:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void Window2::doHideAnimation()
|
|
|
|
{
|
2022-07-16 10:43:05 +08:00
|
|
|
GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(Window2::hideImmediately, this));
|
2020-08-04 13:15:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void Window2::onShown()
|
|
|
|
{
|
|
|
|
_contentPane->getTransition("t1")->play();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Window2::onHide()
|
|
|
|
{
|
|
|
|
_contentPane->getTransition("t1")->stop();
|
|
|
|
}
|