Sources denote the area where particles are emitted from. Template effects commonly support dynamic sources, which means you can pass any of the valid types, and the template will figure out the correct source type to use. The available source types include:
Things to note when using sources:
- These objects are all passed by reference, so if you change their properties after creating the source, the emitter will pick up those changes.
MouseEvents are converted to document-space
Rects before sampling.
dynamicSource(source)sampler checks the type of the passed source using
To use sources in custom effects, one can also manually create sampler methods:
A source sampler is essentially just a method that takes no arguments and returns a
Vector, which means that you are not forced to use one of the sampler-generating methods above - you can just make one yourself!
This sampler can then be passed in the
sourceSampler property of an emitter's