How to create fireworks particle graphics effect on android

前端 未结 3 777
孤城傲影
孤城傲影 2020-12-07 23:02

Anybody has any idea how to make a fireworks effect by drawing on canvas? There is one nice example in wireworks live wallpaper (free app).

There, many points move

3条回答
  •  臣服心动
    2020-12-07 23:59

    That's a very abstract (and interesting) question but far too complex to answer in details.

    What you're really looking for is probably a sort of a modified particle system. A particle system is basically an engine for particles that includes a physics engine.

    However, what you should focus on are these:

    • Memory Pool pattern - useful for fireworks since you don't want to allocate objects during runtime.
    • Particle system tutorial - great and the tutorial is specifically for Android.
    • Particle system - great, but for C++.

    Once you built it (or gotten an understanding about it) you can easily convert it to the Canvas system, although OpenGL is the preferable alternative.

提交回复
热议问题