axmol/tests/fairygui-tests/Classes/CooldownScene.cpp

19 lines
639 B
C++
Raw Normal View History

2020-08-04 13:15:02 +08:00
#include "CooldownScene.h"
USING_NS_AX;
2020-08-04 13:15:02 +08:00
void CooldownScene::continueInit()
{
UIPackage::addPackage("UI/Cooldown");
_view = UIPackage::createObject("Cooldown", "Main")->as<GComponent>();
_groot->addChild(_view);
GProgressBar* btn0 = _view->getChild("b0")->as<GProgressBar>();
GProgressBar* btn1 = _view->getChild("b1")->as<GProgressBar>();
btn0->getChild("icon")->setIcon("icons/k0.png");
btn1->getChild("icon")->setIcon("icons/k1.png");
GTween::to(0, 100, 5)->setTarget(btn0, TweenPropType::Progress)->setRepeat(-1);
GTween::to(10, 0, 10)->setTarget(btn1, TweenPropType::Progress)->setRepeat(-1);
}