function animationsnowflake(x, y, color, radius, speed)
function animFloatTo(from, to, start_time, duration)
local timer = os.clock() - start_time
if timer >= 0.00 and timer <= duration then
local count = timer / (duration / 100)
return from + (count * (to - from) / 100)
end
return (timer > duration) and to or from
end
if clocksnowflake == nil then clocksnowflake = os.clock() end
sun = animFloatTo(0, 25, clocksnowflake, speed)
if sun == 25 then clocksnowflake = nil end
imgui.GetWindowDrawList():AddCircle(imgui.ImVec2(x, y), radius, color, 40)
-- ПЕРВАЯ ЧАСТЬ
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun) * radius, y + math.sin(sun) * radius), imgui.ImVec2(x + math.cos(sun) * radius * 5, y + math.sin(sun) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun) * radius * 3.5, y + math.sin(sun) * radius * 3.5), imgui.ImVec2(x + math.cos(sun + -1150) * radius * 5, y + math.sin(sun + -1150) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun) * radius * 3.5, y + math.sin(sun) * radius * 3.5), imgui.ImVec2(x + math.cos(sun + 1150) * radius * 5, y + math.sin(sun + 1150) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun) * radius * 3, y + math.sin(sun) * radius * 3), imgui.ImVec2(x + math.cos(sun + -1150) * radius * 4, y + math.sin(sun + -1150) * radius * 4), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun) * radius * 3, y + math.sin(sun) * radius * 3), imgui.ImVec2(x + math.cos(sun + 1150) * radius * 4, y + math.sin(sun + 1150) * radius * 4), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun) * radius * 2, y + math.sin(sun) * radius * 2), imgui.ImVec2(x + math.cos(sun + -1150.442) * radius * 3.5,y + math.sin(sun + -1150.442) * radius * 3.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun) * radius * 1.5, y + math.sin(sun) * radius * 1.5), imgui.ImVec2(x + math.cos(sun + -1150.442) * radius * 2.5, y + math.sin(sun + -1150.442) * radius * 2.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun) * radius * 2, y + math.sin(sun) * radius * 2), imgui.ImVec2(x + math.cos(sun + 1150.442) * radius * 3.5, y + math.sin(sun + 1150.442) * radius * 3.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun) * radius * 1.5, y + math.sin(sun) * radius * 1.5), imgui.ImVec2(x + math.cos(sun + 1150.442) * radius * 2.5,y + math.sin(sun + 1150.442) * radius * 2.5), color)
-- ВТОРАЯ ЧАСТЬ
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 1.25) * radius, y + math.sin(sun + 1.25) * radius),imgui.ImVec2(x + math.cos(sun + 1.25) * radius * 5, y + math.sin(sun + 1.25) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 1.25) * radius * 3.5, y + math.sin(sun + 1.25) * radius * 3.5), imgui.ImVec2(x + math.cos(sun + 1.25 + -1150) * radius * 5, y + math.sin(sun + 1.25 + -1150) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 1.25) * radius * 3.5, y + math.sin(sun + 1.25) * radius * 3.5), imgui.ImVec2(x + math.cos(sun + 1.25 + 1150) * radius * 5, y + math.sin(sun + 1.25 + 1150) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 1.25) * radius * 3, y + math.sin(sun + 1.25) * radius * 3), imgui.ImVec2(x + math.cos(sun + 1.25 + -1150) * radius * 4, y + math.sin(sun + 1.25 + -1150) * radius * 4), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 1.25) * radius * 3, y + math.sin(sun + 1.25) * radius * 3), imgui.ImVec2(x + math.cos(sun + 1.25 + 1150) * radius * 4, y + math.sin(sun + 1.25 + 1150) * radius * 4), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 1.25) * radius * 2, y + math.sin(sun + 1.25) * radius * 2), imgui.ImVec2(x + math.cos(sun + 1.25 + 1150.442) * radius * 3.5, y + math.sin(sun + 1.25 + 1150.442) * radius * 3.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 1.25) * radius * 1.5, y + math.sin(sun + 1.25) * radius * 1.5),imgui.ImVec2(x + math.cos(sun + 1.25 + 1150.442) * radius * 2.5, y + math.sin(sun + 1.25 + 1150.442) * radius * 2.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 1.25) * radius * 2, y + math.sin(sun + 1.25) * radius * 2), imgui.ImVec2(x + math.cos(sun + 1.25 + -1150.442) * radius * 3.5, y + math.sin(sun + 1.25 + -1150.442) * radius * 3.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 1.25) * radius * 1.5, y + math.sin(sun + 1.25) * radius * 1.5), imgui.ImVec2(x + math.cos(sun + 1.25 + -1150.442) * radius * 2.5, y + math.sin(sun + 1.25 + -1150.442) * radius * 2.5), color)
-- ТРЕТЬЯ ЧАСТЬ
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 2.5) * radius, y + math.sin(sun + 2.5) * radius), imgui.ImVec2(x + math.cos(sun + 2.5) * radius * 5, y + math.sin(sun + 2.5) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 2.5) * radius * 3.5, y + math.sin(sun + 2.5) * radius * 3.5), imgui.ImVec2(x + math.cos(sun + 2.5 + -1150) * radius * 5, y + math.sin(sun + 2.5 + -1150) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 2.5) * radius * 3.5, y + math.sin(sun + 2.5) * radius * 3.5), imgui.ImVec2(x + math.cos(sun + 2.5 + 1150) * radius * 5, y + math.sin(sun + 2.5 + 1150) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 2.5) * radius * 3, y + math.sin(sun + 2.5) * radius * 3), imgui.ImVec2(x + math.cos(sun + 2.5 + -1150) * radius * 4, y + math.sin(sun + 2.5 + -1150) * radius * 4), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 2.5) * radius * 3, y + math.sin(sun + 2.5) * radius * 3), imgui.ImVec2(x + math.cos(sun + 2.5 + 1150) * radius * 4, y + math.sin(sun + 2.5 + 1150) * radius * 4), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 2.5) * radius * 2, y + math.sin(sun + 2.5) * radius * 2), imgui.ImVec2(x + math.cos(sun + 2.5 + 1150.442) * radius * 3.5, y + math.sin(sun + 2.5 + 1150.442) * radius * 3.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 2.5) * radius * 1.5, y + math.sin(sun + 2.5) * radius * 1.5),imgui.ImVec2(x + math.cos(sun + 2.5 + 1150.442) * radius * 2.5, y + math.sin(sun + 2.5 + 1150.442) * radius * 2.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 2.5) * radius * 2, y + math.sin(sun + 2.5) * radius * 2), imgui.ImVec2(x + math.cos(sun + 2.5 + -1150.442) * radius * 3.5, y + math.sin(sun + 2.5 + -1150.442) * radius * 3.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 2.5) * radius * 1.5, y + math.sin(sun + 2.5) * radius * 1.5), imgui.ImVec2(x + math.cos(sun + 2.5 + -1150.442) * radius * 2.5, y + math.sin(sun + 2.5 + -1150.442) * radius * 2.5), color)
-- ЧЕТВЕРТАЯ часть
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 3.75) * radius, y + math.sin(sun + 3.75) * radius),imgui.ImVec2(x + math.cos(sun + 3.75) * radius * 5, y + math.sin(sun + 3.75) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 3.75) * radius * 3.5, y + math.sin(sun + 3.75) * radius * 3.5), imgui.ImVec2(x + math.cos(sun + 3.75 + -1150) * radius * 5, y + math.sin(sun + 3.75 + -1150) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 3.75) * radius * 3.5, y + math.sin(sun + 3.75) * radius * 3.5), imgui.ImVec2(x + math.cos(sun + 3.75 + 1150) * radius * 5, y + math.sin(sun + 3.75 + 1150) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 3.75) * radius * 3, y + math.sin(sun + 3.75) * radius * 3), imgui.ImVec2(x + math.cos(sun + 3.75 + -1150) * radius * 4, y + math.sin(sun + 3.75 + -1150) * radius * 4), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 3.75) * radius * 3, y + math.sin(sun + 3.75) * radius * 3), imgui.ImVec2(x + math.cos(sun + 3.75 + 1150) * radius * 4, y + math.sin(sun + 3.75 + 1150) * radius * 4), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 3.75) * radius * 2, y + math.sin(sun + 3.75) * radius * 2), imgui.ImVec2(x + math.cos(sun + 3.75 + 1150.442) * radius * 3.5, y + math.sin(sun + 3.75 + 1150.442) * radius * 3.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 3.75) * radius * 1.5, y + math.sin(sun + 3.75) * radius * 1.5),imgui.ImVec2(x + math.cos(sun + 3.75 + 1150.442) * radius * 2.5, y + math.sin(sun + 3.75 + 1150.442) * radius * 2.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 3.75) * radius * 2, y + math.sin(sun + 3.75) * radius * 2), imgui.ImVec2(x + math.cos(sun + 3.75 + -1150.442) * radius * 3.5, y + math.sin(sun + 3.75 + -1150.442) * radius * 3.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 3.75) * radius * 1.5, y + math.sin(sun + 3.75) * radius * 1.5), imgui.ImVec2(x + math.cos(sun + 3.75 + -1150.442) * radius * 2.5, y + math.sin(sun + 3.75 + -1150.442) * radius * 2.5), color)
-- ПЯТАЯ ЧАСТЬ
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 5) * radius, y + math.sin(sun + 5) * radius),imgui.ImVec2(x + math.cos(sun + 5) * radius * 5,y + math.sin(sun + 5) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 5) * radius * 3.5, y + math.sin(sun + 5) * radius * 3.5), imgui.ImVec2(x + math.cos(sun + 5 + -1150) * radius * 5,y + math.sin(sun + 5 + -1150) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 5) * radius * 3.5, y + math.sin(sun + 5) * radius * 3.5), imgui.ImVec2(x + math.cos(sun + 5 + 1150) * radius * 5, y + math.sin(sun + 5 + 1150) * radius * 5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 5) * radius * 3, y + math.sin(sun + 5) * radius * 3), imgui.ImVec2(x + math.cos(sun + 5 + -1150) * radius * 4, y + math.sin(sun + 5 + -1150) * radius * 4), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 5) * radius * 3, y + math.sin(sun + 5) * radius * 3), imgui.ImVec2(x + math.cos(sun + 5 + 1150) * radius * 4, y + math.sin(sun + 5 + 1150) * radius * 4), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 5) * radius * 2, y + math.sin(sun + 5) * radius * 2), imgui.ImVec2(x + math.cos(sun + 5 + 1150.465) * radius * 3.5, y + math.sin(sun + 5 + 1150.465) * radius * 3.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 5) * radius * 1.5, y + math.sin(sun + 5) * radius * 1.5),imgui.ImVec2(x + math.cos(sun + 5 + 1150.465) * radius * 2.5, y + math.sin(sun + 5 + 1150.465) * radius * 2.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 5) * radius * 2, y + math.sin(sun + 5) * radius * 2), imgui.ImVec2(x + math.cos(sun + 5 + -1150.465) * radius * 3.5,y + math.sin(sun + 5 + -1150.465) * radius * 3.5), color)
imgui.GetWindowDrawList():AddLine(imgui.ImVec2(x + math.cos(sun + 5) * radius * 1.5, y + math.sin(sun + 5) * radius * 1.5), imgui.ImVec2(x + math.cos(sun + 5 + -1150.465) * radius * 2.5,y + math.sin(sun + 5 + -1150.465) * radius * 2.5), color)
end