|
郁金香灬外挂技术
https://www.yjxsoft.com/
本教程视频1920*1080分辩率下观看最佳
VS2017+win10 64位 环境
郁金香老师:Q扣 150330575
欢迎大家参加 郁金香灬技术 游戏安全与外挂的研究学习。
兴趣是我们最好的老师
成长需要过程与循序渐进
兴趣+坚持+时间+优秀的教程会帮助你快速成功
交流扣扣群 29817979,9569245
学习目标:
PushID
PopID
// Color buttons, demonstrate using PushID() to add unique identifier in the ID stack, and changing style.
IMGUI_DEMO_MARKER("Widgets/Basic/Buttons (Colored)");
for (int i = 0; i < 8; i++)
{
if (i > 0) ImGui::SameLine();
ImGui::PushID(i);
ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(i / 7.0f, 0.6f, 0.6f));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(i / 7.0f, 0.7f, 0.7f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(i / 7.0f, 0.8f, 0.8f));
static int index = 0;
if (ImGui::Button("xxxxx"))
{
index = i;
//函数处理case(i)
}
ImGui::SameLine();
ImGui::Text("Button index=%d", index);
ImGui::PopStyleColor(3);
ImGui::PopID();
//H透明度
//HBGR
ImGui::PushStyleColor(ImGuiCol_Text, 0xFF0000FF);// (ImVec4)ImColor::HSV(i / 7.0f, 0.6f, 0.6f));
// ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(i / 7.0f, 0.7f, 0.7f));
//ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(i / 7.0f, 0.8f, 0.8f));
ImGui::SameLine();
ImGui::Text("test");
ImGui::PopStyleColor(1);
// ImGui::PushID(i);
ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(i / 7.0f, 0.6f, 0.6f));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(i / 7.0f, 0.7f, 0.7f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(i / 7.0f, 0.8f, 0.8f));
static int index2 = 0;
ImGui::SameLine();
if (ImGui::Button("3xxxxx##"))
{
index2 = index2 +1;
}
ImGui::Text("Button index2=%d", index2);
// ImGui::PopID();
ImGui::PopStyleColor(3);
}
void 处理按钮事件(int index)
{
switch (index)
{
case 1:
{
printf("line=%d\r\n", __LINE__);
break;
}
case 2:
{
printf("line=%d\r\n", __LINE__);
break;
}
case 3:
{
printf("line=%d\r\n", __LINE__);
break;
}
case 4:
{
printf("line=%d\r\n", __LINE__);
break;
}
case 5:
{
printf("line=%d\r\n", __LINE__);
break;
}
case 6:
{
printf("line=%d\r\n", __LINE__);
break;
}
case 7:
{
printf("line=%d\r\n", __LINE__);
break;
}
case 8:
{
MessageBoxA(0, "OK test", "测试", 0);
printf("line=%d\r\n", __LINE__);
break;
}
case 9:
{
printf("09 ->line=%d\r\n", __LINE__);
break;
}
case 10:
{
printf("10 ->line=%d\r\n", __LINE__);
break;
}
default:
break;
}
}
void CDX11::控件数组测试PushID()
{
ImGui::Begin(u8"控件数组测试PushID");
static int index = 1;
ImGui::SameLine();
ImGui::Text("index=%d", index);
for (int i = 1; i <= 10; i++)
{
//## sprintf_s
ImGui::PushID(i);
if (ImGui::Button("Button123"))
{
处理按钮事件(i);
index = i;
}
ImGui::PopID();
}
ImGui::PushID(33);
if (ImGui::Button("Button123"))
{
处理按钮事件(10);
printf("第1111111个按钮\n");
}
ImGui::PopID();
//ImGui::PushID(33);
//if (ImGui::Button("Button123"))
//{
// 处理按钮事件(10);
// printf("第22222个按钮\n");
//}
//ImGui::PopID();
ImGui::End();
ImGui::Begin(u8"控件数组测试PushID2");
ImGui::PushID(33);
if (ImGui::Button("Button123"))
{
处理按钮事件(10);
printf("第22222个按钮\n");
}
ImGui::PopID();
ImGui::End();
}
|
|