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


C++ LabelWidget::scrolledOff方法代码示例

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


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

示例1: onUpdate

// ----------------------------------------------------------------------------
void MainMenuScreen::onUpdate(float delta,  irr::video::IVideoDriver* driver)
{
    IconButtonWidget* addons_icon = getWidget<IconButtonWidget>("addons");
    if (addons_icon != NULL)
    {
        if (addons_manager->wasError())
        {
            addons_icon->setActivated();
            addons_icon->resetAllBadges();
            addons_icon->setBadge(BAD_BADGE);
        }
        else if (addons_manager->isLoading() && UserConfigParams::m_internet_status
                == INetworkHttp::IPERM_ALLOWED)
        {
            // Addons manager is still initialising/downloading.
            addons_icon->setDeactivated();
            addons_icon->resetAllBadges();
            addons_icon->setBadge(LOADING_BADGE);
        }
        else 
        {
            addons_icon->setActivated();
            addons_icon->resetAllBadges();
        }
        // maybe add a new badge when not allowed to access the net
    }

    LabelWidget* w = getWidget<LabelWidget>("info_addons");
    w->update(delta);
    if(w->scrolledOff())
    {
        const core::stringw &news_text = news_manager->getNextNewsMessage();
        w->setText(news_text, true);
    }
}   // onUpdate
开发者ID:langresser,项目名称:stk,代码行数:36,代码来源:main_menu_screen.cpp

示例2: onUpdate

// ----------------------------------------------------------------------------
void MainMenuScreen::onUpdate(float delta)

{
    PlayerProfile *player = PlayerManager::getCurrentPlayer();
    if(PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_GUEST  ||
       PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_SIGNED_IN)
    {
        m_user_id->setText(player->getLastOnlineName() + "@stk");
        m_online->setActivated();
        m_online->setLabel( _("Online"));
    }
    else if (PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_SIGNED_OUT)
    {
        m_online->setActivated();
        m_online->setLabel( _("Login" ));
        m_user_id->setText(player->getName());
    }
    else 
    {
        // now must be either logging in or logging out
        m_online->setDeactivated();
        m_user_id->setText(player->getName());
    }

    m_online->setLabel(PlayerManager::getCurrentOnlineId() ? _("Online")
                                                           : _("Login" )  );
    IconButtonWidget* addons_icon = getWidget<IconButtonWidget>("addons");
    if (addons_icon != NULL)
    {
        if (addons_manager->wasError())
        {
            addons_icon->setActivated();
            addons_icon->resetAllBadges();
            addons_icon->setBadge(BAD_BADGE);
        }
        else if (addons_manager->isLoading() && UserConfigParams::m_internet_status
            == Online::RequestManager::IPERM_ALLOWED)
        {
            // Addons manager is still initialising/downloading.
            addons_icon->setDeactivated();
            addons_icon->resetAllBadges();
            addons_icon->setBadge(LOADING_BADGE);
        }
        else
        {
            addons_icon->setActivated();
            addons_icon->resetAllBadges();
        }
        // maybe add a new badge when not allowed to access the net
    }

    LabelWidget* w = getWidget<LabelWidget>("info_addons");
    w->update(delta);
    if(w->scrolledOff())
    {
        const core::stringw &news_text = NewsManager::get()->getNextNewsMessage();
        w->setText(news_text, true);
    }
}   // onUpdate
开发者ID:Charence,项目名称:stk-code,代码行数:60,代码来源:main_menu_screen.cpp


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