郁金香灬老师 游戏安全  驱动 逆向调试 C/C++编程  脚本 UE4/UE5

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
课程大纲和价格
官方联系方式2024在线课大纲QQ咨询
查看: 4409|回复: 0

021-imGui窗口中的进度条UI控件Progress Bar

[复制链接]

132

主题

29

回帖

34万

积分

管理员

积分
343636
QQ
发表于 2023-4-7 21:34:55 | 显示全部楼层 |阅读模式

郁金香灬外挂技术
       
        https://www.yjxsoft.com/
       
        本教程视频1920*1080分辩率下观看最佳
        VS2017+win10 64位 环境
        郁金香老师:Q扣 150330575
        欢迎大家参加 郁金香灬技术 游戏安全与外挂的研究学习。
       
        兴趣是我们最好的老师
        成长需要过程与循序渐进        
        兴趣+坚持+时间+优秀的教程会帮助你快速成功

    交流扣扣群 29817979,9569245


学习目标:
   imGui窗口中的进度条UI控件 Progress Bar
   imGui窗口中的进度条UI接口

  ImGui::ProgressBar(
  progress2, //要显示的百分比 范围是0-1.0f
  ImVec2(300.0f, 22.f),  //设置宽度和高度
  buf); //buf 要覆盖的格式化字符串




void CDX11::进度条UI控件测试()
{

     static float progress1 = 0.0f;
     static float progress2 = 1.1f;
     static bool animate = true;
     if (animate)
     {
         progress1 += 0.001f;
         if (progress1 >= 1.0f)  progress1 = 0.0f;

         progress2 -= 0.001f;
         if (progress2 <= 0.0f)  progress2 = 1.1f;

     }

     // Typically we would use ImVec2(-1.0f,0.0f) or ImVec2(-FLT_MIN,0.0f) to use all available width,
     // or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth.
     char buf[256] = { 0 };
     sprintf_s(buf, "test=%0.2f", progress1);
     ImGui::ProgressBar(progress1, ImVec2(300.0f,22.0f));   
     ImGui::ProgressBar(progress2, ImVec2(300.0f, 22.f), buf); //buf

   //  ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
     ImGui::Text("Progress Bar progress1=%f", progress1);
     ImGui::Text("Progress Bar progress2=%f", progress2);

};





          void CDX11::进度条UI控件测试()
          {
              //0.0f  1.0f
             //1111代码块
              {
                  static float progress1 = 0.1f;

              if (progress1 < 1.0f)
              {
                  progress1 = progress1 + 0.001f;
              }
              else
              {
                  progress1 = 0.1f;
              }
              // if (progress1 >= 1.0f) progress1 = 1.0f;
               // Typically we would use ImVec2(-1.0f,0.0f) or ImVec2(-FLT_MIN,0.0f) to use all available width,
               // or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth.
              char buf[256] = { 0 };
              sprintf_s(buf, "test=%0.2f", progress1);
              ImGui::ProgressBar(progress1); // 第二个参数 省掉  ImVec2(500.0f, 122.0f)


              //  ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
              ImGui::Text("Progress Bar progress1=%f", progress1);
          }


             //测试代码块22222
              {
                  //0.0f  1.0f
                  static float progress1 = 0.1f;

                  if (progress1 < 1.0f)
                  {
                      progress1 = progress1 + 0.001f;
                  }
                  else
                  {
                      progress1 = 0.1f;
                  }
                  // if (progress1 >= 1.0f) progress1 = 1.0f;
                   // Typically we would use ImVec2(-1.0f,0.0f) or ImVec2(-FLT_MIN,0.0f) to use all available width,
                   // or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth.
                  char buf[256] = { 0 }; //ProgressBar的第三个参数overlay 是用来覆盖掉原有的 百分比数字
                  sprintf_s(buf, "<<<<%0.2f%%>>>>>", progress1*100);
                  ImGui::ProgressBar(progress1,ImVec2(-1.0f,0), buf); // 第二个参数 省掉  ImVec2(500.0f, 122.0f)


                  //  ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
                  ImGui::Text("Progress Bar progress1=%f", progress1);

              }

          };







游戏安全课程 学员办理咨询联系QQ150330575 手机 139 9636 2600  免费课程 在 www.bilibili.com 搜 郁金香灬老师
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ咨询

QQ|Archiver|手机版|小黑屋|郁金香游戏技术

GMT+8, 2024-5-17 21:23 , Processed in 0.089154 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表