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


C++ Globals::render方法代码示例

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


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

示例1:

    void
    Outro::on_draw()
    {
        if (m_snd_game_exit != NULL)
        {
            if (timer_elapsed() > static_cast<unsigned int>(m_snd_game_exit->length_in_ms) + 100)
            {
                next_state();
            }
        }

        Globals g;

        g.render().DrawTile(0,0, g.values().res_w(), g.values().res_h(), m_img_mainmenu);

        string text1 = g.snd2txt().text();
        string text2 = "";

        if (text1.length() >= 25)
        {
            text2 = text1;
            text1.erase(25, string::npos);
            text2.erase(0, 25);
        }
        g.render().DrawText(500, 400, 1.0, 1.0, 1.0, text1);
        g.render().DrawText(500, 450, 1.0, 1.0, 1.0, text2);
    }
开发者ID:mmatyas,项目名称:Atomic-Bomberman,代码行数:27,代码来源:stateoutro.cpp

示例2:

void
ConfigureKeys::on_draw()
{
#ifndef DISABLE_LIBSIGC
    Globals g;

    // background image
    g.render().DrawTile(0, 0, g.values().res_w(), g.values().res_h(), m_bg);

    int width  = g.values().res_w();
    int half   = width / 2;
    int quarter= width / 4;

    SDL_Rect top = {quarter - 220, 80, width - 2*(quarter-220), 80};
    SDL_Rect rl  = {quarter - 220, 170, half - 50, 500};
    SDL_Rect rr  = {half + (half -(quarter - 220 + (half - 50))), 170, half - 50, 500};

    g.render().FillRect(top,.0, .0, .0, 0.5f);
    g.render().FillRect(rl ,.0, .0, .0, 0.5f);
    g.render().FillRect(rr ,.0, .0, .0, 0.5f);

    m_con_active.draw_all();
    m_con_passive.draw_all();

    draw_player_keys();

    m_anim_bomb.Update();

    if (mb_grab_key)
    {
        draw_grab_key();
        m_anim_bomb.Draw(quarter - 185, 740, 50, 50);
        m_anim_bomb.Draw(quarter - 220 + (width - 2*(quarter-220)) - 45, 740, 50, 50);
    }
    else
    {
        int index = m_con_active.current_focused();
        m_anim_bomb.Draw(quarter-145 + 512*(index>5?1:0), 142 + 75*((index>5?(index-6):index)+1), 50, 50);
    }
#endif // DISABLE_LIBSIGC
}
开发者ID:mmatyas,项目名称:Atomic-Bomberman,代码行数:41,代码来源:stateconfigurekeys.cpp

示例3: switch

void
ConfigureKeys::draw_grab_key()
{
    Globals g;
    int width  = g.values().res_w();
    int height = g.values().res_h();
    int quarter= width / 4;

    SDL_Rect r = {quarter - 220, 680, width - 2*(quarter-220), 70};

    g.render().FillRect(r, .0, .0, .0, .5f);

    string str = "Press a key for ";

    switch (m_which_player)
    {
        case 0: str += "Player 1!"; break;
        case 1: str += "Player 2!"; break;
    }

    g.render().SetTextSizes(24, 24);
    g.render().DrawText(r, 255, 255, 255, str);
}
开发者ID:mmatyas,项目名称:Atomic-Bomberman,代码行数:23,代码来源:stateconfigurekeys.cpp


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