pub struct EmitterMold {Show 36 fields
pub texture: Option<Rc<dyn Texture>>,
pub max_particles: usize,
pub type_: EmitterType,
pub emit_x_variance: f32,
pub emit_y_variance: f32,
pub alpha_start: f32,
pub alpha_start_variance: f32,
pub alpha_end: f32,
pub alpha_end_variance: f32,
pub angle: f32,
pub angle_variance: f32,
pub duration: f32,
pub gravity_x: f32,
pub gravity_y: f32,
pub max_radius: f32,
pub max_radius_variance: f32,
pub min_radius: f32,
pub lifespan_variance: f32,
pub lifespan: f32,
pub rotate_per_second: f32,
pub rotate_per_second_variance: f32,
pub rotation_start: f32,
pub rotation_start_variance: f32,
pub rotation_end: f32,
pub rotation_end_variance: f32,
pub size_start: f32,
pub size_start_variance: f32,
pub size_end: f32,
pub size_end_variance: f32,
pub speed: f32,
pub speed_variance: f32,
pub radial_accel: f32,
pub radial_accel_variance: f32,
pub tangential_accel: f32,
pub tangential_accel_variance: f32,
pub blend_mode: Option<BlendMode>,
/* private fields */
}
Expand description
A particle system configuration, that can be used to create emitter sprites. The configuration is loaded from a .pex file, authored in a tool such as Particle Designer.
NOTE: There are some restrictions to keep in mind when using Particle Designer:
- Particle coloring is not supported.
- Only normal and additive blend modes are supported.
Also keep in mind that gratuitous particle systems are a great way to kill performance, especially on mobile. Try to keep maxParticles as low as possible to achieve the desired effect.
Fields
texture: Option<Rc<dyn Texture>>
max_particles: usize
type_: EmitterType
emit_x_variance: f32
emit_y_variance: f32
alpha_start: f32
alpha_start_variance: f32
alpha_end: f32
alpha_end_variance: f32
angle: f32
angle_variance: f32
duration: f32
gravity_x: f32
gravity_y: f32
max_radius: f32
max_radius_variance: f32
min_radius: f32
lifespan_variance: f32
lifespan: f32
rotate_per_second: f32
rotate_per_second_variance: f32
rotation_start: f32
rotation_start_variance: f32
rotation_end: f32
rotation_end_variance: f32
size_start: f32
size_start_variance: f32
size_end: f32
size_end_variance: f32
speed: f32
speed_variance: f32
radial_accel: f32
radial_accel_variance: f32
tangential_accel: f32
tangential_accel_variance: f32
blend_mode: Option<BlendMode>
Implementations
sourceimpl EmitterMold
impl EmitterMold
sourcepub fn new(pack: impl AssetPack, name: String) -> Self
pub fn new(pack: impl AssetPack, name: String) -> Self
Creates an EmitterMold using files in an asset pack. @param name The path to the particle system within the asset pack, excluding the .pex suffix.
sourcepub fn dispose_files(&mut self) -> &Self
pub fn dispose_files(&mut self) -> &Self
Disposes the source .pex File used to create this EmitterMold. This can free up some memory, if you don’t intend to recreate this EmitterMold later from the same AssetPack.
@returns This instance, for chaining.
sourcepub fn create_emitter(&self) -> EmitterSprite
pub fn create_emitter(&self) -> EmitterSprite
Creates a new EmitterSprite using this mold.
Trait Implementations
sourceimpl Debug for EmitterMold
impl Debug for EmitterMold
sourceimpl Default for EmitterMold
impl Default for EmitterMold
sourcefn default() -> EmitterMold
fn default() -> EmitterMold
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for EmitterMold
impl !Send for EmitterMold
impl !Sync for EmitterMold
impl Unpin for EmitterMold
impl !UnwindSafe for EmitterMold
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
sourcefn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.