小穿资源分享
Открыть в Telegram
This Channel follows Telegram Terms.No adult content, no violence, no spam.
БольшеСтрана не указанаКатегория не указана
992
Подписчики
-324 часа
-27 дней
+5830 дней
Архив постов
992
bool test = true;
if (test){
static ImVec2 dvdPos(100.0f, 100.0f);
static ImVec2 dvdVelocity(4.0f, 3.0f);
float screenWidth = ImGui::GetIO().DisplaySize.x;
float screenHeight = ImGui::GetIO().DisplaySize.y;
float textWidth = 200.0f;
float textHeight = 50.0f;
dvdPos.x += dvdVelocity.x;
dvdPos.y += dvdVelocity.y;
if (dvdPos.x <= 0 || dvdPos.x + textWidth >= screenWidth) {
dvdVelocity.x = -dvdVelocity.x;
}
if (dvdPos.y <= 0 || dvdPos.y + textHeight >= screenHeight) {dvdVelocity.y = -dvdVelocity.y;}
ImDrawList* drawList = ImGui::GetBackgroundDrawList();
drawList->AddText(ImGui::GetFont(),60.0f,ImVec2(dvdPos.x, dvdPos.y),IM_COL32(255, 255, 255, 180),"text");
}
992
窗口技术
void RenderSingleMenuWindow() {
ImGui::SetNextWindowSize(ImVec2(950, 600), ImGuiCond_Always);
ImGui::PushStyleColor(ImGuiCol_WindowBg, IM_COL32(255, 255, 255, 230));
ImGui::PushStyleColor(ImGuiCol_Border, IM_COL32(220, 220, 220, 200));
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 25.0f);
if (ImGui::Begin("SingleMenuWindow", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse)) {
//这个里面就是窗口内容
}
ImGui::End();
ImGui::PopStyleVar();
ImGui::PopStyleColor(2);
}