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


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

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


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

示例1: createScorePopup

void HUDDemo::createScorePopup(const CEGUI::Vector2<float>& mousePos, int points)
{
    CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();

    CEGUI::Window* popupWindow = winMgr.createWindow("HUDDemo/PopupLabel");
    d_rootIngame->addChild(popupWindow);
    popupWindow->setPosition(CEGUI::UVector2(cegui_absdim(mousePos.d_x), cegui_absdim(mousePos.d_y)));
    popupWindow->setText(CEGUI::PropertyHelper<int>::toString(points));
    popupWindow->setRiseOnClickEnabled(false);
    popupWindow->subscribeEvent(AnimationInstance::EventAnimationEnded, Event::Subscriber(&HUDDemo::handleScorePopupAnimationEnded, this));
    popupWindow->setPixelAligned(false);
    popupWindow->setFont("DejaVuSans-14");

    popupWindow->setPosition(popupWindow->getPosition() + CEGUI::UVector2(cegui_reldim(0.03f), cegui_reldim(-0.02f)));

    if(points < 0)
        popupWindow->setProperty("NormalTextColour", "FF880000");
    else
    {
        popupWindow->setText( "+" + popupWindow->getText());
        popupWindow->setProperty("NormalTextColour", "FF006600");
    }

    CEGUI::EventArgs args;
    popupWindow->fireEvent("StartAnimation", args);
}
开发者ID:scw000000,项目名称:Engine,代码行数:26,代码来源:HUDemo.cpp

示例2: spawnPlate

CEGUI::Window* HUDDemo::spawnPlate()
{
    CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();

    CEGUI::Window* plateRoot = winMgr.createWindow("DefaultWindow");
    plateRoot->setSize(CEGUI::USize(cegui_absdim(0.0f), cegui_reldim(0.16f)));
    plateRoot->setAspectMode(CEGUI::AM_EXPAND);
    plateRoot->setAspectRatio(1.0f);
    plateRoot->setRiseOnClickEnabled(false);
    plateRoot->setPixelAligned(false);
    plateRoot->subscribeEvent(CEGUI::Window::EventMouseButtonDown, Event::Subscriber(&HUDDemo::handlePlateWindowClicked, this));
    d_rootIngame->addChild(plateRoot);

    CEGUI::Window* plateImgWnd = winMgr.createWindow("Generic/Image", "ImageWindowPlate");
    plateImgWnd->setProperty("Image", s_imageNamePlate);
    plateImgWnd->setSize(CEGUI::USize(cegui_reldim(1.0f), cegui_absdim(0.0f)));
    plateImgWnd->setAspectRatio(3.308f);
    plateImgWnd->setAspectMode(CEGUI::AM_EXPAND);
    plateImgWnd->setVerticalAlignment(CEGUI::VA_BOTTOM);
    plateImgWnd->setMousePassThroughEnabled(true);
    plateImgWnd->setPixelAligned(false);
    plateRoot->addChild(plateImgWnd);

    CEGUI::String image = getRandomGameImage();

    CEGUI::Window* plateTopping = winMgr.createWindow("Generic/Image", "ImageWindowObject");
    plateTopping->setProperty("Image", image);
    plateTopping->setSize(CEGUI::USize(cegui_reldim(0.88f), cegui_absdim(0.0f)));
    plateTopping->setAspectRatio(1.0f);
    plateTopping->setAspectMode(CEGUI::AM_EXPAND);
    plateTopping->setHorizontalAlignment(CEGUI::HA_CENTRE);
    plateTopping->setMousePassThroughEnabled(true);
    plateTopping->setPixelAligned(false);
    plateRoot->addChild(plateTopping);


    int randumNumber = rand() % 10000;
    float posY = randumNumber / 10000.0f;

    plateRoot->setPosition(CEGUI::UVector2(cegui_absdim(0.0f), cegui_reldim(0.1f + 0.6f * posY)));

    return plateRoot;
}
开发者ID:scw000000,项目名称:Engine,代码行数:43,代码来源:HUDemo.cpp

示例3: UDim

CHUD::CHUD(CEGUI::Window *pGUIRoot, CGUIToolsMenu *pGUIToolsMenu)
    : m_bShotToolIndicators(pGUIToolsMenu == NULL),
      m_pGUIToolsMenu(pGUIToolsMenu),
      m_fTimer(0),
      m_fHP(1),
      m_fMP(1)
{
    m_pHudRoot = pGUIRoot->createChild("DefaultWindow", "HudRoot");
    m_pHudRoot->setInheritsAlpha(false);
    m_pHudRoot->setAlpha(1);
    m_pHudRoot->setRiseOnClickEnabled(false);
    CEGUI::ImageManager::getSingleton().loadImageset("hud.imageset");
    ImageManager::getSingleton().loadImageset("white.imageset");
    ImageManager::getSingleton().loadImageset("hud_weapons.imageset");

    CEGUI::Window *pMain = m_pHudRoot->createChild("OgreTray/StaticText", "main");
    pMain->setRiseOnClickEnabled(false);
    pMain->setProperty("BackgroundEnabled", "false");
    pMain->setProperty("FrameEnabled", "false");
    pMain->setPosition(UVector2(UDim(0, 0), UDim(0, 0)));
    pMain->setSize(USize(UDim(1, 0), UDim(1, 0)));
    //pMain->setText("test");
    //pMain->setAlpha(0.5);

    CEGUI::Window *pTopBar = pMain->createChild("OgreTray/StaticImage", "top_bar");
    pTopBar->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0), CEGUI::UDim(0, 0)));
    pTopBar->setSize(CEGUI::USize(CEGUI::UDim(1, 0), CEGUI::UDim(0.1667f, 0)));
    pTopBar->setProperty("Image", "hud/top_bar");
    pTopBar->setProperty("FrameEnabled","False");
    pTopBar->setProperty("BackgroundEnabled","False");
    pTopBar->setRiseOnClickEnabled(false);

    Window *pBottomBar = pMain->createChild("OgreTray/StaticImage", "bottom_bar");
    pBottomBar->setSize(USize(UDim(0.28125, 0), UDim(0.05859375, 0)));
    pBottomBar->setPosition(UVector2(UDim(0.359375, 0), UDim(0.94140625, 0)));
    pBottomBar->setProperty("Image", "hud/bottom_bar");
    pBottomBar->setProperty("FrameEnabled","False");
    pBottomBar->setProperty("BackgroundEnabled","False");
    pBottomBar->setRiseOnClickEnabled(false);

    m_pFpsText = pBottomBar->createChild("OgreTray/StaticText", "fpstext");
    m_pFpsText->setProperty("TextColours", "FFFFFFFF");
    m_pFpsText->setProperty("FrameEnabled","False");
    m_pFpsText->setProperty("BackgroundEnabled","False");
    m_pFpsText->setSize(USize(UDim(0.2, 0), UDim(0.3, 0)));
    m_pFpsText->setPosition(UVector2(UDim(0.605, 0), UDim(0.66, 0)));
    m_pFpsText->setText("00");
    m_pFpsText->setFont("dejavusans8");
    m_pFpsText->setRiseOnClickEnabled(false);

    m_pTimeText = pBottomBar->createChild("OgreTray/StaticText", "timetext");
    m_pTimeText->setProperty("TextColours", "FFFFFFFF");
    m_pTimeText->setProperty("FrameEnabled","False");
    m_pTimeText->setProperty("BackgroundEnabled","False");
    m_pTimeText->setSize(USize(UDim(0.3, 0), UDim(0.3, 0)));
    m_pTimeText->setPosition(UVector2(UDim(0.22, 0), UDim(0.66, 0)));
    m_pTimeText->setText("0:00:00");
    m_pTimeText->setFont("dejavusans8");
    m_pTimeText->setRiseOnClickEnabled(false);

    m_pHealthBar = pMain->createChild("OgreTray/StaticImage", "healthbar");
    m_pHealthBar->setProperty("ImageColours", "FFFF00FF");
    m_pHealthBar->setProperty("Image", "white/full_image");
    m_pHealthBar->setProperty("FrameEnabled","False");
    m_pHealthBar->setProperty("BackgroundEnabled","True");
    m_pHealthBar->setPosition(UVector2(UDim(0.051757813, 0), UDim(0.026041667, 0)));
    m_pHealthBar->setRiseOnClickEnabled(false);

    m_pManaBar = pMain->createChild("OgreTray/StaticImage", "manabar");
    m_pManaBar->setProperty("ImageColours", "FFFF00FF");
    m_pManaBar->setProperty("Image", "white/full_image");
    m_pManaBar->setProperty("FrameEnabled", "False");
    m_pManaBar->setProperty("BackgroundEnabled", "True");
    m_pManaBar->setPosition(UVector2(UDim(0.772460938, 0), UDim(0.026041667, 0)));
    m_pManaBar->setRiseOnClickEnabled(false);

#if ENABLE_INPUT_TOUCH != 1
    Window *pWeaponContainer = pMain->createChild("OgreTray/StaticImage", "weaponContainer");
    pWeaponContainer->setProperty("FrameEnabled", "False");
    pWeaponContainer->setProperty("BackgroundEnabled", "False");
    pWeaponContainer->setProperty("Image", "hud/weapon_indicator");
    pWeaponContainer->setPosition(UVector2(UDim(0, 0), UDim(0.908854, 0)));
    pWeaponContainer->setSize(USize(UDim(0.0683594, 0), UDim(0.091145833, 0)));

    m_pWeapon = pMain->createChild("OgreTray/StaticImage", "weapon");
    m_pWeapon->setProperty("FrameEnabled", "False");
    m_pWeapon->setProperty("BackgroundEnabled", "True");
    m_pWeapon->setPosition(UVector2(UDim(0.020507813, 0), UDim(0.936197917, 0)));
    m_pWeapon->setSize(USize(UDim(0.028320313, 0), UDim(0.037760417, 0)));
#endif

    if (m_bShotToolIndicators) {
        Window *pImg = pMain->createChild("OgreTray/StaticImage", "HPImg");
        pImg->setProperty("FrameEnabled","False");
        pImg->setProperty("BackgroundEnabled","False");
        pImg->setSize(CEGUI::USize(UDim(0, 32), UDim(0, 32)));
        pImg->setPosition(CEGUI::UVector2(CEGUI::UDim(0.8, -16), CEGUI::UDim(0.98, -24)));
        pImg->setProperty("Image", "hud_weapons/health_potion");

        m_pHealthPotionsCount = pMain->createChild("OgreTray/StaticText", "HPCount");
//.........这里部分代码省略.........
开发者ID:ChWick,项目名称:Mencus,代码行数:101,代码来源:HUD.cpp

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