当前位置: 首页>>代码示例>>C++>>正文


C++ Window::setInheritsAlpha方法代码示例

本文整理汇总了C++中cegui::Window::setInheritsAlpha方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::setInheritsAlpha方法的具体用法?C++ Window::setInheritsAlpha怎么用?C++ Window::setInheritsAlpha使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cegui::Window的用法示例。


在下文中一共展示了Window::setInheritsAlpha方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createChild

CGUIStatistics::CGUIStatistics(Window *pRoot)
  : m_iSelectedSlot(0) {
  CInputListenerManager::getSingleton().addInputListener(this);
  // create cegui windows/buttons
  Window *pStatisticsRoot = pRoot->createChild("DefaultWindow", "GUIStatisticsRoot");
  pStatisticsRoot->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0), CEGUI::UDim(0, 0)));
  pStatisticsRoot->setSize(CEGUI::USize(CEGUI::UDim(1, 0), CEGUI::UDim(1, 0)));
  pStatisticsRoot->setInheritsAlpha(false);
  pStatisticsRoot->setAlpha(1);
  pStatisticsRoot->setRiseOnClickEnabled(false);
  pStatisticsRoot->moveToBack();
  m_pStatisticsRoot = pStatisticsRoot;

  CEGUI::Window *pBackground = pStatisticsRoot->
    createChild("OgreTray/StaticImage", "Background");
  pBackground->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0), CEGUI::UDim(0, 0)));
  pBackground->setSize(CEGUI::USize(CEGUI::UDim(1, 0), CEGUI::UDim(1, 0)));
  pBackground->setInheritsAlpha(false);
  pBackground->setAlpha(1);
  pBackground->setProperty("Image", "main_menu_background/full");
  pBackground->setProperty("FrameEnabled", "False");
  pBackground->setProperty("BackgroundEnabled", "True");
  pBackground->setRiseOnClickEnabled(false);

  CEGUI::Window *pButtonContainer = pStatisticsRoot->createChild("DefaultWindow", "ButtonContainer");
  pButtonContainer->setPosition(UVector2(UDim(0, 0), UDim(0, 0)));
  pButtonContainer->setSize(USize(UDim(1, 0), UDim(1, 0)));

  CEGUI::Window *pFinishedText = pButtonContainer->createChild("OgreTray/Titlebar", "text");
  pFinishedText->setFont("dejavusans20");
  pFinishedText->setText("unset");
  pFinishedText->setPosition(UVector2(UDim(0.05,0), UDim(0.05,0)));
  pFinishedText->setSize(USize(UDim(0.9, 0), UDim(0.1, 0)));

  CEGUI::Window *pStatisticsGroup = pButtonContainer->createChild("OgreTray/Group", "statisticsgroup");
  pStatisticsGroup->setFont("dejavusans16");
  pStatisticsGroup->setText(XMLResources::GLOBAL.getCEGUIString("Statistics"));
  pStatisticsGroup->setPosition(UVector2(UDim(0.1, 0), UDim(0.2, 0)));
  pStatisticsGroup->setSize(USize(UDim(0.8, 0), UDim(0.5, 0)));

  CEGUI::Window *pRetryButton = pButtonContainer->createChild("OgreTray/Button", "Retry");
  pRetryButton->setPosition(UVector2(UDim(0.1, 0), UDim(0.8, 0)));
  pRetryButton->setSize(USize(UDim(0.3, 0), UDim(0.15, 0)));
  pRetryButton->setFont("dejavusans16");
  pRetryButton->setText(XMLResources::GLOBAL.getCEGUIString("Retry"));
  m_pButtons[BT_RETRY] = pRetryButton;
  pRetryButton->subscribeEvent(
			       CEGUI::PushButton::EventClicked,
			       CEGUI::Event::Subscriber(&CGUIStatistics::onRetryClicked, this));


  CEGUI::Window *pToMenuButton = pButtonContainer->createChild("OgreTray/Button", "ToMenu");
  pToMenuButton->setPosition(UVector2(UDim(0.6, 0), UDim(0.8, 0)));
  pToMenuButton->setSize(USize(UDim(0.3, 0), UDim(0.15, 0)));
  pToMenuButton->setFont("dejavusans16");
  pToMenuButton->setText(XMLResources::GLOBAL.getCEGUIString("To level selection"));
  pToMenuButton->subscribeEvent(
				CEGUI::PushButton::EventClicked,
				CEGUI::Event::Subscriber(&CGUIStatistics::onToMenuClicked, this));
  m_pButtons[BT_TO_MENU] = pToMenuButton;

  for (int i = 0; i < L_COUNT; i++) {
    createLabel(i, pStatisticsGroup, false);
    createLabel(i, pStatisticsGroup, true);
  }

  hide();
}
开发者ID:ChWick,项目名称:Mencus,代码行数:68,代码来源:GUIStatistics.cpp


注:本文中的cegui::Window::setInheritsAlpha方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。