Ejemplo n.º 1
0
void render::render_BattleTeam(Team& team, unsigned int turn){
    texture.loadFromFile(BATTLEMENU, ren);
    texture.render(ren, 0, getmaxy() - 128);

    SDL_Color textColor = {0xD8, 0xC6, 0x91};

    std::vector<std::string> nameList = team.getNameList();
    for(unsigned int i = 0; i < nameList.size(); i++){

        if(i == turn)textColor = { 0xF4, 0xF0, 0xDD };{
            //Print Informations
            char tmp[100];

            texture.loadFromRenderedText(team[nameList[i]].getName().c_str(), textColor, ren, font_comic16);
            texture.render(ren, 20, getmaxy() - 128 + 15 * (i + 1));

            sprintf(tmp, "%d/%d", team[nameList[i]].getHP(), team[nameList[i]].getMaxHP());
            texture.loadFromRenderedText(tmp, textColor, ren, font_comic16);
            texture.render(ren, 150, getmaxy() - 128 + 15 * (i + 1));

            sprintf(tmp, "%d/%d", team[nameList[i]].getMP(), team[nameList[i]].getMaxMP());
            texture.loadFromRenderedText(tmp, textColor, ren, font_comic16);
            texture.render(ren, 250, getmaxy() - 128 + 15 * (i + 1));

        }textColor = {0xD8, 0xC6, 0x91};
    }

    //update();
}
Ejemplo n.º 2
0
void render::render_TeamMenu(Team& team, unsigned int curPos){
    clear();

    std::vector<std::string> memberList = team.getNameList();

    clear();
    texture.loadFromFile(FRAME, ren);
    texture.render(ren, 0, 0);

    Point offset;
    offset.m_x = getmaxx() / 2;
    offset.m_y = getmaxy() / 2;

    SDL_Color textColor = {0xD8, 0xC6, 0x91};

    //Print Title
    texture.loadFromRenderedText("TEAM", textColor, ren, font_comic50);
    texture.render(ren, offset.m_x - texture.getWidth() / 2, 8);

    for (unsigned int i = 0; i < memberList.size(); i++){
        if(i == curPos)
            texture.loadFromFile("data/menu/charmenu_selected.png", ren);
        else
            texture.loadFromFile("data/menu/charmenu.png", ren);

        texture.render(ren, 10, 80 + i * 130);

        char tmp[100];

        //Print Informations
        sprintf(tmp, "Name : %s", team[memberList[i]].getName().c_str());
        texture.loadFromRenderedText(tmp, textColor, ren, font_comic16);
        texture.render(ren, 20, 100 + i * 130);

        sprintf(tmp, "Level : %d", team[memberList[i]].getLevel());
        texture.loadFromRenderedText(tmp, textColor, ren, font_comic16);
        texture.render(ren, 350, 100 + i * 130);

        sprintf(tmp, "Role : %s", team[memberList[i]].getRoleName().c_str());
        texture.loadFromRenderedText(tmp, textColor, ren, font_comic16);
        texture.render(ren, 20, 130 + i * 130);

        sprintf(tmp, "HP : %d/%d", team[memberList[i]].getHP(), team[memberList[i]].getMaxHP());
        texture.loadFromRenderedText(tmp, textColor, ren, font_comic16);
        texture.render(ren, 20, 160 + i * 130);

        sprintf(tmp, "MP : %d/%d", team[memberList[i]].getMP(), team[memberList[i]].getMaxMP());
        texture.loadFromRenderedText(tmp, textColor, ren, font_comic16);
        texture.render(ren, 300, 160 + i * 130);

        sprintf(tmp, "EXP : %d/%d", team[memberList[i]].getExp(), team[memberList[i]].getLevelUpExp());
        texture.loadFromRenderedText(tmp, textColor, ren, font_comic16);
        texture.render(ren, 600, 160 + i * 130);
    }

    update();

}