Use Canvas to make particle effect . RRS feed

  • Question

  • I want make particle effect explosion using control Canvas (Window universal C#). Please help me a guide or give me an example.


    Friday, January 23, 2015 3:28 PM


  • Canvas isn't really the go-to control for a particle effect. Like all of Xaml, it is retained mode vector graphics based rather than raster graphics. You could create a bunch of Image controls with your sprites and then animate their RenderTransforms to move them.

    For particle effects take a look at the Win2d API which exposes Direct2D functionality to Xaml apps. If you want a 3D particle effect you'll need to interop to a Direct3D. Windows doesn't include a C# interface for D3D, so you'll need to use either C++ or a 3rd party interop layer such as SharpDX.

    Once there you'll do normal particle system stuff: choose the properties of the particles and create an emitter to track and draw the particles. There are many articles on the general concepts, and the details will depend on what exactly you need to do. If you have specific questions you can ask them when you get to that point.

    Friday, January 23, 2015 4:19 PM