Search code examples
iosxcodeswiftsprite-kitskemitternode

Sprite Kit Particle Emitter Shape


How can a particle emitter be set to produce shapes (solid shapes/Core Graphics?), instead of texture images (png)?

In the documentation Manipulating the Particle Emitter, it looks like only a texture image can be set.


Solution

  • Only a SKTexture can be used, but that doesn't stop you from using SKShapeNode to create shapes and then create a SKTexture of that shape via the SKView method textureFromNode:.