本文整理汇总了C++中UILayout类的典型用法代码示例。如果您正苦于以下问题:C++ UILayout类的具体用法?C++ UILayout怎么用?C++ UILayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UILayout类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PageInit
void CocosGUIExamplesPageScene::PageInit()
{
// page root from json
UILayout* page_root = dynamic_cast<UILayout*>(GUIReader::shareReader()->widgetFromJsonFile("cocosgui/gui_examples/page_1/page_1.json"));
m_pUILayer->addWidget(page_root);
// page layout
UILayout* page_layout = dynamic_cast<UILayout*>(page_root->getChildByName("page_panel"));
// page view add to page layout
UIPageView* pageView = UIPageView::create();
pageView->setTouchEnable(true);
pageView->setSize(page_layout->getContentSize());
// layout add to page view
for (int i = 0; i < 4; ++i)
{
UILayout* layout = UILayout::create();
layout->setSize(pageView->getContentSize());
UIImageView* imageView = UIImageView::create();
imageView->setTouchEnable(true);
imageView->loadTexture(page_image_textures[i]);
imageView->setPosition(ccp(layout->getContentSize().width / 2, layout->getContentSize().height / 2));
layout->addChild(imageView);
pageView->addPage(layout);
}
pageView->addPageTurningEvent(this, coco_PageView_PageTurning_selector(CocosGUIExamplesPageScene::pageTurningEvent));
page_layout->addChild(pageView);
}
开发者ID:2uemg8sq98r3,项目名称:cocos2d-x,代码行数:31,代码来源:CocosGUIExamplesPageScene.cpp
示例2: NiStream
UILayout* UICreator::CreateUILayoutFromFile(const char* file, cocos2d::CCNode *pParent,
bool bShow )
{
// Load plist layout file
UILayout* pLayer = NULL;
NiStream * pkStream = new NiStream();
pLayer = (UILayout*)(pkStream->CreateControlFromFile(file, pParent));
delete pkStream;
if(NULL == pLayer)
{
return NULL;
}
// update containers reference object
std::list<UIControlBase*> childContainers = pLayer->getAllChildEndsWithName("Container");
for(std::list<UIControlBase*>::iterator it = childContainers.begin();
it != childContainers.end(); it++)
{
if(dynamic_cast<UIContainer*>(*it) != NULL)
{
UIContainer *tmp = static_cast<UIContainer*>(*it);
if(tmp->getRefMode() == OBJECT_REFERENCE)
{
std::string refObjName = tmp->getRefObjName();
UIControlBase *refObj = pLayer->FindChildObjectByName(refObjName);
if(refObj != NULL && dynamic_cast<UIContainer*>(refObj) != NULL)
{
tmp->setRefObj(static_cast<UIContainer*>(refObj));
}
}
}
}
// update scroll pages
std::list<UIControlBase*> childScrollPages = pLayer->getAllChildEndsWithName("ScrollPage");
for(std::list<UIControlBase*>::iterator it = childScrollPages.begin();
it != childScrollPages.end(); it++)
{
if(dynamic_cast<UIScrollPage*>(*it) != NULL)
{
UIScrollPage *tmp = static_cast<UIScrollPage*>(*it);
tmp->addPagesByChildren();
}
}
float scaleFactor = UIManager::sharedManager()->getScaleFactor();
//float scaleFactorX = UIManager::sharedManager()->getScaleFactorX();
//float scaleFactorY = UIManager::sharedManager()->getScaleFactorY();
pLayer->setScale(scaleFactor);
//pLayer->setScale(scaleFactorX, scaleFactorY);
return pLayer;
}
开发者ID:niuzb,项目名称:hellopet,代码行数:55,代码来源:UICreator.cpp
示例3: Object
SampleSelector::SampleSelector(Context* context) :
Object(context)
{
UIView* view = FeatureExamples::GetUIView();
UILayout* rootLayout = new UILayout(context_);
rootLayout->SetAxis(UI_AXIS_Y);
rootLayout->SetRect(view->GetRect());
view->AddChild(rootLayout);
const char* examples[] = {
"Hello World",
"Hello GUI",
"Render to Texture",
"2D Sprite",
"2D Physics",
"2D Constraints",
"2D Rope",
"2D Spriter Animation",
"3D Static Scene",
"3D Animating Scene",
"3D Light Animation",
"3D Billboards",
"3D Particles",
"3D Physics",
"3D Skeletal Animation",
"3D Decals",
"3D Character",
"3D Dynamic Geometry",
"3D Ragdolls",
"3D Vehicle Demo",
"3D Crowd Navigation",
"3D Water",
"3D Multiple Viewports"
};
for (size_t i = 0; i < sizeof(examples) / sizeof(examples[0]); i++)
{
UIButton* button = new UIButton(context_);
button->SetLayoutMinWidth(128);
button->SetText(examples[i]);
button->SetId(examples[i]);
button->SubscribeToEvent(button, E_WIDGETEVENT, ATOMIC_HANDLER(SampleSelector, HandleWidgetEvent));
rootLayout->AddChild(button);
}
Input* input = GetSubsystem<Input>();
input->SetMouseVisible(true);
input->SetMouseMode(MM_FREE);
// Subscribe key up event
SubscribeToEvent(E_KEYUP, ATOMIC_HANDLER(SampleSelector, HandleKeyUp));
context->RegisterSubsystem(this);
}
开发者ID:LumaDigital,项目名称:AtomicExamples,代码行数:55,代码来源:SampleSelector.cpp
示例4: UILayout
UILayout* UILayout::create()
{
UILayout* layout = new UILayout();
if (layout && layout->init())
{
layout->autorelease();
return layout;
}
CC_SAFE_DELETE(layout);
return NULL;
}
开发者ID:ShortTailLab,项目名称:cocos2d-x,代码行数:11,代码来源:UILayout.cpp
示例5: init
bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init()
{
if (UIScene::init())
{
CCSize widgetSize = m_pWidget->getSize();
// Add a label in which the dragpanel events will be displayed
m_pDisplayValueLabel = UILabel::create();
// m_pDisplayValueLabel->setText("No Event");
m_pDisplayValueLabel->setFontName("Marker Felt");
m_pDisplayValueLabel->setFontSize(32);
m_pDisplayValueLabel->setAnchorPoint(ccp(0.5f, -1));
m_pDisplayValueLabel->setPosition(ccp(widgetSize.width / 2.0f, widgetSize.height / 2.0f + m_pDisplayValueLabel->getSize().height * 1.5));
m_pUiLayer->addWidget(m_pDisplayValueLabel);
// Add the alert
UILabel *alert = UILabel::create();
alert->setText("ScrollView scroll to percent both directrion bounce");
alert->setFontName("Marker Felt");
alert->setFontSize(20);
alert->setColor(ccc3(159, 168, 176));
alert->setPosition(ccp(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5));
m_pUiLayer->addWidget(alert);
UILayout* background = dynamic_cast<UILayout*>(m_pUiLayer->getWidgetByName("background_Panel"));
UIScrollView* sc = UIScrollView::create();
sc->setBackGroundColor(ccGREEN);
sc->setBackGroundColorType(LAYOUT_COLOR_SOLID);
sc->setBounceEnabled(true);
sc->setDirection(SCROLLVIEW_DIR_BOTH);
sc->setInnerContainerSize(CCSizeMake(480, 320));
sc->setSize(CCSizeMake(100,100));
CCSize backgroundSize = background->getContentSize();
sc->setPosition(ccp((widgetSize.width - backgroundSize.width) / 2 +
(backgroundSize.width - sc->getSize().width) / 2,
(widgetSize.height - backgroundSize.height) / 2 +
(backgroundSize.height - sc->getSize().height) / 2));
sc->scrollToPercentBothDirection(ccp(50, 50), 1, true);
UIImageView* iv = UIImageView::create();
iv->loadTexture("cocosgui/Hello.png");
iv->setPosition(ccp(240, 160));
sc->addChild(iv);
m_pUiLayer->addWidget(sc);
return true;
}
return false;
}
开发者ID:a494008974,项目名称:cocos2d-x,代码行数:49,代码来源:UIScrollViewTest.cpp
示例6: SendEvent
void UI::HandleUpdate(StringHash eventType, VariantMap& eventData)
{
if (exitRequested_) {
SendEvent(E_EXITREQUESTED);
exitRequested_ = false;
return;
}
tooltipHoverTime_ += eventData[Update::P_TIMESTEP].GetFloat();
if (tooltipHoverTime_ >= 0.5f)
{
UIWidget* hoveredWidget = GetHoveredWidget();
if (hoveredWidget && !tooltip_ && (hoveredWidget->GetShortened() || hoveredWidget->GetTooltip().Length() > 0))
{
tooltip_ = new UIPopupWindow(context_, true, hoveredWidget, "tooltip");
UILayout* tooltipLayout = new UILayout(context_, UI_AXIS_Y, true);
if (hoveredWidget->GetShortened())
{
UITextField* fullTextField = new UITextField(context_, true);
fullTextField->SetText(hoveredWidget->GetText());
tooltipLayout->AddChild(fullTextField);
}
if (hoveredWidget->GetTooltip().Length() > 0)
{
UITextField* tooltipTextField = new UITextField(context_, true);
tooltipTextField->SetText(hoveredWidget->GetTooltip());
tooltipLayout->AddChild(tooltipTextField);
}
Input* input = GetSubsystem<Input>();
IntVector2 mousePosition = input->GetMousePosition();
tooltip_->AddChild(tooltipLayout);
tooltip_->Show(mousePosition.x_ + 8, mousePosition.y_ + 8);
}
}
else
{
if (tooltip_) tooltip_->Close();
}
SendEvent(E_UIUPDATE);
TBMessageHandler::ProcessMessages();
}
开发者ID:marynate,项目名称:AtomicGameEngine,代码行数:43,代码来源:UI.cpp
示例7: getParent
bool UIWidget::clippingParentAreaContainPoint(const cocos2d::Point &pt)
{
m_bAffectByClipping = false;
UIWidget* parent = getParent();
UIWidget* clippingParent = nullptr;
while (parent)
{
UILayout* layoutParent = dynamic_cast<UILayout*>(parent);
if (layoutParent)
{
if (layoutParent->isClippingEnabled())
{
m_bAffectByClipping = true;
clippingParent = layoutParent;
break;
}
}
parent = parent->getParent();
}
if (!m_bAffectByClipping)
{
return true;
}
if (clippingParent)
{
bool bRet = false;
if (clippingParent->hitTest(pt))
{
bRet = true;
}
if (bRet)
{
return clippingParent->clippingParentAreaContainPoint(pt);
}
return false;
}
return true;
}
开发者ID:mcodegeeks,项目名称:OpenKODE-Framework,代码行数:41,代码来源:UIWidget.cpp
示例8: init
bool UIPageViewTest::init()
{
if (UIScene::init())
{
CCSize widgetSize = m_pWidget->getSize();
// Add a label in which the dragpanel events will be displayed
m_pDisplayValueLabel = UILabel::create();
m_pDisplayValueLabel->setText("Move by horizontal direction");
m_pDisplayValueLabel->setFontName("Marker Felt");
m_pDisplayValueLabel->setFontSize(32);
m_pDisplayValueLabel->setAnchorPoint(ccp(0.5f, -1));
m_pDisplayValueLabel->setPosition(ccp(widgetSize.width / 2.0f, widgetSize.height / 2.0f + m_pDisplayValueLabel->getContentSize().height * 1.5));
m_pUiLayer->addWidget(m_pDisplayValueLabel);
// Add the black background
UILabel *alert = UILabel::create();
alert->setText("PageView");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
alert->setColor(ccc3(159, 168, 176));
alert->setPosition(ccp(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075));
m_pUiLayer->addWidget(alert);
UILayout *background = dynamic_cast<UILayout*>(m_pUiLayer->getWidgetByName("background_Panel"));
// Create the page view
UIPageView* pageView = UIPageView::create();
pageView->setTouchEnabled(true);
pageView->setSize(CCSizeMake(240, 130));
CCSize backgroundSize = background->getContentSize();
pageView->setPosition(ccp((widgetSize.width - backgroundSize.width) / 2 +
(backgroundSize.width - pageView->getSize().width) / 2,
(widgetSize.height - backgroundSize.height) / 2 +
(backgroundSize.height - pageView->getSize().height) / 2));
for (int i = 0; i < 3; ++i)
{
UILayout* layout = UILayout::create();
layout->setSize(CCSizeMake(240, 130));
UIImageView* imageView = UIImageView::create();
imageView->setTouchEnabled(true);
imageView->setScale9Enabled(true);
imageView->loadTexture("cocosgui/scrollviewbg.png");
imageView->setSize(CCSizeMake(240, 130));
imageView->setPosition(ccp(layout->getSize().width / 2, layout->getSize().height / 2));
layout->addChild(imageView);
UILabel* label = UILabel::create();
label->setText(CCString::createWithFormat("page %d", (i + 1))->getCString());
label->setFontName("Marker Felt");
label->setFontSize(30);
label->setColor(ccc3(192, 192, 192));
label->setPosition(ccp(layout->getSize().width / 2, layout->getSize().height / 2));
layout->addChild(label);
pageView->addPage(layout);
}
pageView->addEventListenerPageView(this, pagevieweventselector(UIPageViewTest::pageViewEvent));
m_pUiLayer->addWidget(pageView);
return true;
}
return false;
}
开发者ID:1901,项目名称:cocos2d-x,代码行数:67,代码来源:UIPageViewTest.cpp
示例9: init
bool UILayoutTest_Color::init()
{
if (UIScene::init())
{
CCSize widgetSize = m_pWidget->getSize();
// Add the alert
UILabel* alert = UILabel::create();
alert->setText("Layout color render");
alert->setFontName("Marker Felt");
alert->setFontSize(30);
alert->setColor(ccc3(159, 168, 176));
alert->setPosition(ccp(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075));
m_pUiLayer->addWidget(alert);
UILayout *background = dynamic_cast<UILayout*>(m_pUiLayer->getWidgetByName("background_Panel"));
// Create the layout with color render
UILayout* layout = UILayout::create();
layout->setBackGroundColorType(LAYOUT_COLOR_SOLID);
layout->setBackGroundColor(ccc3(128, 128, 128));
layout->setSize(CCSizeMake(280, 150));
CCSize backgroundSize = background->getContentSize();
layout->setPosition(ccp((widgetSize.width - backgroundSize.width) / 2 +
(backgroundSize.width - layout->getSize().width) / 2,
(widgetSize.height - backgroundSize.height) / 2 +
(backgroundSize.height - layout->getSize().height) / 2));
m_pUiLayer->addWidget(layout);
UIButton* button = UIButton::create();
button->setTouchEnabled(true);
button->loadTextures("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png", "");
button->setPosition(ccp(button->getSize().width / 2, layout->getSize().height - button->getSize().height / 2));
layout->addChild(button);
UIButton* titleButton = UIButton::create();
titleButton->setTouchEnabled(true);
titleButton->loadTextures("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png", "");
titleButton->setTitleText("Title Button");
titleButton->setPosition(ccp(layout->getSize().width / 2, layout->getSize().height / 2));
layout->addChild(titleButton);
UIButton* button_scale9 = UIButton::create();
button_scale9->setTouchEnabled(true);
button_scale9->loadTextures("cocosui/button.png", "cocosui/buttonHighlighted.png", "");
button_scale9->setScale9Enabled(true);
button_scale9->setSize(CCSizeMake(100, button_scale9->getContentSize().height));
button_scale9->setPosition(ccp(layout->getSize().width - button_scale9->getSize().width / 2, button_scale9->getSize().height / 2));
layout->addChild(button_scale9);
return true;
}
return false;
}
开发者ID:aboduo,项目名称:cocos2dx-classical,代码行数:54,代码来源:UILayoutTest.cpp
示例10: CCSize
bool SelectMenuView::init()
{
char tmp[32];
UILayer::init();
// background
UIImageView* background = UIImageView::create();
background->loadTexture("level_bg.jpg",UI_TEX_TYPE_PLIST);
background->setAnchorPoint(CCPoint(0,0));
this->addWidget(background);
// Beauty Card
UIPageView* scrollView = UIPageView::create();
scrollView->setTouchEnabled(true);
scrollView->setSize( CCSize( GAME_WIDTH, GAME_HEIGHT * 3 / 4 ) );
scrollView->setPosition(CCPoint( 0, GAME_HEIGHT/8 ));
scrollView->setName("scrollView");
UILayout* widgetBeautyCard = (UILayout*)GUIReader::shareReader()->widgetFromJsonFile("BeautyCard.ExportJson");
for( int i = 0; i < MAX_BEAUTY_NUM; i++ )
{
Layout* layout = Layout::create();
layout->setSize(CCSize(GAME_WIDTH, GAME_HEIGHT * 3 / 4));
ScrollButton* button = ScrollButton::create();
button->setSize(CCSize(160,200));
UILayout* widget = NULL;
if(i == 0)
{
widget = widgetBeautyCard;
}
else
{
widget = static_cast<UILayout*>(widgetBeautyCard->clone());
}
widget->setAnchorPoint(CCPoint( 0.5f, 0.5f));
button->setPosition(CCPoint(GAME_WIDTH/2,GAME_HEIGHT* 3 / 8));
sprintf(tmp,"beautyCard%d",i);
button->setName(tmp);
//widget->setPosition( Point( GAME_WIDTH * i, 0 ) );
button->setTag( i + CARD_TAG );
button->addChild(widget);
layout->addChild( button );
scrollView->addPage( layout );
}
//CC_SAFE_DELETE(widgetTree);
//CC_SAFE_DELETE(jsonDict);
//CC_SAFE_DELETE_ARRAY(des);
scrollView->addEventListener(this, pagevieweventselector(SelectMenuView::onPageViewMove));
this->addWidget( scrollView );
// bottom
UIWidget* bottomWidget = (UIWidget*)GUIReader::shareReader()->widgetFromJsonFile("SelectUI.ExportJson");
bottomWidget->setName("bottomUIWidget");
this->addWidget( bottomWidget );
// buttton
UIButton* button_back = static_cast<UIButton*>( bottomWidget->getChildByName("Button_back") );
UIButton* button_seal = static_cast<UIButton*>( bottomWidget->getChildByName("Button_seal") );
button_back->addTouchEventListener(this,toucheventselector(SelectMenuView::onTouchButton));
button_back->setTouchEnabled(true);
button_back->setPressedActionEnabled(true);
button_seal->addTouchEventListener(this,toucheventselector(SelectMenuView::onTouchButton));
button_seal->setTouchEnabled(true);
button_seal->setPressedActionEnabled(true);
// Evil Mask panel
_panelEvil = (UIWidget*)GUIReader::shareReader()->widgetFromJsonFile("PanelEvil.ExportJson");
_panelEvil->retain();
// unlock panel
_panelUnlock = (UIWidget*)GUIReader::shareReader()->widgetFromJsonFile("PanelSelectLock.ExportJson");
_panelUnlock->retain();
return true;
}
开发者ID:pplasto,项目名称:SleepBeauty,代码行数:82,代码来源:SelectMenuView.cpp
示例11: UIPopupWindow
//.........这里部分代码省略.........
if (widget->IsOfType<TBTextField>())
{
UITextField* textfield = new UITextField(context_, false);
textfield->SetWidget(widget);
widgetWrap_[widget] = textfield;
return textfield;
}
if (widget->IsOfType<TBEditField>())
{
UIEditField* editfield = new UIEditField(context_, false);
editfield->SetWidget(widget);
widgetWrap_[widget] = editfield;
return editfield;
}
if (widget->IsOfType<TBSkinImage>())
{
UISkinImage* skinimage = new UISkinImage(context_, "", false);
skinimage->SetWidget(widget);
widgetWrap_[widget] = skinimage;
return skinimage;
}
if (widget->IsOfType<TBImageWidget>())
{
UIImageWidget* imagewidget = new UIImageWidget(context_, false);
imagewidget->SetWidget(widget);
widgetWrap_[widget] = imagewidget;
return imagewidget;
}
if (widget->IsOfType<TBClickLabel>())
{
UIClickLabel* nwidget = new UIClickLabel(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<TBCheckBox>())
{
UICheckBox* nwidget = new UICheckBox(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<TBSelectList>())
{
UISelectList* nwidget = new UISelectList(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<TBMessageWindow>())
{
UIMessageWindow* nwidget = new UIMessageWindow(context_, NULL, "", false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<TBTabContainer>())
{
UITabContainer* nwidget = new UITabContainer(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<SceneViewWidget>())
{
UISceneView* nwidget = new UISceneView(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<TBLayout>())
{
UILayout* layout = new UILayout(context_, (UI_AXIS) widget->GetAxis(), false);
layout->SetWidget(widget);
widgetWrap_[widget] = layout;
return layout;
}
if (widget->IsOfType<TBWidget>())
{
UIWidget* nwidget = new UIWidget(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
return 0;
}
开发者ID:marynate,项目名称:AtomicGameEngine,代码行数:101,代码来源:UI.cpp
示例12: UIPopupWindow
//.........这里部分代码省略.........
if (widget->IsOfType<TBClickLabel>())
{
UIClickLabel* nwidget = new UIClickLabel(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBCheckBox>())
{
UICheckBox* nwidget = new UICheckBox(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBRadioButton>())
{
UIRadioButton* nwidget = new UIRadioButton(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBBarGraph>())
{
UIBargraph* nwidget = new UIBargraph(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBSelectList>())
{
UISelectList* nwidget = new UISelectList(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBMessageWindow>())
{
UIMessageWindow* nwidget = new UIMessageWindow(context_, NULL, "", false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBPromptWindow>())
{
UIPromptWindow* nwidget = new UIPromptWindow(context_, NULL, "", false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBFinderWindow>())
{
UIFinderWindow* nwidget = new UIFinderWindow(context_, NULL, "", false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBTabContainer>())
{
UITabContainer* nwidget = new UITabContainer(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<SceneViewWidget>())
{
UISceneView* nwidget = new UISceneView(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBLayout>())
{
UILayout* layout = new UILayout(context_, (UI_AXIS) widget->GetAxis(), false);
layout->SetWidget(widget);
WrapWidget(layout, widget);
return layout;
}
if (widget->IsOfType<TBWidget>())
{
UIWidget* nwidget = new UIWidget(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
return 0;
}
开发者ID:abandonrules,项目名称:AtomicGameEngine,代码行数:101,代码来源:UI.cpp
注:本文中的UILayout类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论