axmol/tests/fairygui-tests/Source/BagScene.cpp

26 lines
553 B
C++
Raw Normal View History

2020-08-04 13:15:02 +08:00
#include "BagScene.h"
USING_NS_AX;
2020-08-04 13:15:02 +08:00
BagScene::BagScene() :_bagWindow(nullptr)
{
}
BagScene::~BagScene()
{
2022-07-15 19:17:01 +08:00
AX_SAFE_RELEASE(_bagWindow);
2020-08-04 13:15:02 +08:00
}
void BagScene::continueInit()
{
UIPackage::addPackage("UI/Bag");
UIConfig::horizontalScrollBar = "";
UIConfig::verticalScrollBar = "";
_view = UIPackage::createObject("Bag", "Main")->as<GComponent>();
_groot->addChild(_view);
_bagWindow = BagWindow::create();
_bagWindow->retain();
_view->getChild("bagBtn")->addClickListener([this](EventContext*) { _bagWindow->show(); });
}