admin 发表于 2023-3-28 15:45:28

006-imGui窗口中的Button按钮




006-imGui窗口中的Button按钮




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


学习目标:
imGui窗口中添加Button按钮
Button
ButtonEx
响应按键的设置
   
   // Extend ImGuiButtonFlags_ 按钮标志
enum ImGuiButtonFlagsPrivate_

    IMGUI_API bool    Button(const char* label, const ImVec2& size = ImVec2(0, 0));   // button
    IMGUI_API bool    ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);
       
       
       ImGui::Begin("222");
      {
            //设置窗口位置
            ImVec2 pos = { 100,100+300+20 };
            ImGui::SetWindowPos(pos);
            ImVec2 nSize = { 300,200 };
            ImGui::SetWindowSize(nSize);
          //ImGui::Button("Button150", nSize);
            ImVec2 btnsize = { 120, 20 };
            if (ImGui::ButtonEx("Button1", btnsize, ImGuiButtonFlags_::ImGuiButtonFlags_MouseButtonRight))
            {
                MessageBoxA(0, "Button 鼠标右键被按下", 0, 0);
            };

            
            if(ImGui::ButtonEx("Button2", ImVec2(100,30), ImGuiButtonFlags_::ImGuiButtonFlags_MouseButtonLeft))
            {
                MessageBoxA(0, "Button2 鼠标左键被按下", 0, 0);
            };;

            if (ImGui::ButtonEx("Button3", ImVec2(100, 30), ImGuiButtonFlags_::ImGuiButtonFlags_MouseButtonMiddle))
            {
                MessageBoxA(0, "Button3 鼠标中键被按下", 0, 0);
            };;


      }
      ImGui::End();
               
       
       
       
void CDX11::CreateMyFrame()
{
      //创建一个窗口帧
      ImGui::Begin("111");
      //{
      //    //设置窗口位置
      //    ImVec2 pos = { 100,100 };
      //    ImGui::SetWindowPos(pos);
      //    ImVec2 nSize = { 300,200 };
      //    ImGui::SetWindowSize(nSize);
      //}      
      ImGui::End();
**** Hidden Message *****


页: [1]
查看完整版本: 006-imGui窗口中的Button按钮