三つの円エフェクト
https://scrapbox.io/files/64d0f55c635dd7001cfd038b.png
code:三つの円エフェクト.cpp
# include <Siv3D.hpp>
struct ThreeRingEffect : IEffect
{
Vec2 m_pos;
ColorF m_color;
//Vec2 位置, ColorF 色
explicit ThreeRingEffect(const Vec2& pos, const ColorF& color = Palette::Orange)
: m_pos{ pos }
, m_color{ color } {}
bool update(double t) override
{
ScopedRenderStates2D blend{ BlendState::Additive };
for (const auto i : step(3)) {
Circle{ OffsetCircular{ m_pos, 10,-t * 180_deg + i * 120_deg }, (t * 50) }.drawFrame(4, ColorF{ m_color ,1 - t });
}
return (t < 1.0);
}
};
void Main()
{
Effect effect;
while (System::Update())
{
if (MouseL.down())
{
effect.add<ThreeRingEffect>(Cursor::Pos());
}
effect.update();
}
}