logo
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: usizetype_: EmitterTypeemit_x_variance: f32emit_y_variance: f32alpha_start: f32alpha_start_variance: f32alpha_end: f32alpha_end_variance: f32angle: f32angle_variance: f32duration: f32gravity_x: f32gravity_y: f32max_radius: f32max_radius_variance: f32min_radius: f32lifespan_variance: f32lifespan: f32rotate_per_second: f32rotate_per_second_variance: f32rotation_start: f32rotation_start_variance: f32rotation_end: f32rotation_end_variance: f32size_start: f32size_start_variance: f32size_end: f32size_end_variance: f32speed: f32speed_variance: f32radial_accel: f32radial_accel_variance: f32tangential_accel: f32tangential_accel_variance: f32blend_mode: Option<BlendMode>

Implementations

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.

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.

Creates a new EmitterSprite using this mold.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Typed getter

Inspect the context.

Inspect the context.

Inspect the context.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert into color

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Sets value as a parameter of self.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.