1 442
给你们泛滥一个人数显示搬运请带频道
@XDRNB7891
extern int totalEnemies;
extern int totalBots;
float centerX = 屏幕宽度 / 2.0f;
float topY = 55.0f;
float boxW = 300.0f;
float boxH = 55.0f;
float radius = 22.0f;
float boxX = centerX - boxW / 2;
float boxY = topY;
draw->AddRectFilled(
ImVec2(boxX, boxY),
ImVec2(boxX + boxW, boxY + boxH),
IM_COL32(255,255,255,180),
radius
);
if(totalEnemies == 0 && totalBots == 0)
{
const char* text = "XDR";
ImVec2 size = ImGui::CalcTextSize(text);
draw->AddText(
NULL,
28,
ImVec2(
centerX - size.x/2,
boxY + 12
),
IM_COL32(0,0,0,255),
text
);
}
else
{
draw->AddCircleFilled(
ImVec2(boxX+45,boxY+34),
13,
IM_COL32(255,50,50,255),
50
);
draw->AddCircleFilled(
ImVec2(boxX+45,boxY+21),
6,
IM_COL32(255,80,80,255),
50
);
draw->AddText(
NULL,
22,
ImVec2(boxX+85,boxY+8),
IM_COL32(0,0,0,255),
"真人"
);
char player[16];
sprintf(player,"%d",totalEnemies);
draw->AddText(
NULL,
30,
ImVec2(boxX+85,boxY+25),
IM_COL32(0,0,0,255),
player
);
draw->AddLine(
ImVec2(centerX,boxY+10),
ImVec2(centerX,boxY+45),
IM_COL32(0,0,0,180),
2
);
draw->AddRectFilled(
ImVec2(centerX+45,boxY+14),
ImVec2(centerX+75,boxY+42),
IM_COL32(255,255,255,255),
8
);
draw->AddText(
NULL,
22,
ImVec2(centerX+90,boxY+8),
IM_COL32(0,0,0,255),
"人机"
);
// 人机数量
char bot[16];
sprintf(bot,"%d",totalBots);
draw->AddText(
NULL,
30,
ImVec2(centerX+90,boxY+25),
IM_COL32(0,0,0,255),
bot
);
}
BY XA12 Sep, 12:41

