Struct macroquad_particles::EmitterConfig[][src]

pub struct EmitterConfig {
    pub local_coords: bool,
    pub emission_shape: EmissionShape,
    pub one_shot: bool,
    pub lifetime: f32,
    pub lifetime_randomness: f32,
    pub explosiveness: f32,
    pub amount: u32,
    pub shape: ParticleShape,
    pub emitting: bool,
    pub initial_direction: Vec2,
    pub initial_direction_spread: f32,
    pub initial_velocity: f32,
    pub initial_velocity_randomness: f32,
    pub linear_accel: f32,
    pub size: f32,
    pub size_randomness: f32,
    pub size_curve: Option<Curve>,
    pub blend_mode: BlendMode,
    pub colors_curve: ColorCurve,
    pub gravity: Vec2,
    pub texture: Option<Texture2D>,
    pub atlas: Option<AtlasConfig>,
    pub material: Option<ParticleMaterial>,
    pub post_processing: Option<PostProcessing>,
}

Fields

local_coords: bool

If false - particles spawns at position supplied to .draw(), but afterwards lives in current camera coordinate system. If false particles use coordinate system originated to the emitter draw position

emission_shape: EmissionShape

Particles will be emitted inside that region.

one_shot: bool

If true only one emission cycle occurs. May be re-emitted by .emit() call.

lifetime: f32

Lifespan of individual particle.

lifetime_randomness: f32

Particle lifetime randomness ratio. Each particle will spawned with “lifetime = lifetime - lifetime * rand::gen_range(0.0, lifetime_randomness)”.

explosiveness: f32

0..1 value, how rapidly particles in emission cycle are emitted. With 0 particles will be emitted with equal gap. With 1 all the particles will be emitted at the beginning of the cycle.

amount: u32

Amount of particles emitted in one emission cycle.

shape: ParticleShape

Shape of each individual particle mesh.

emitting: bool

Particles are emitting when “emitting” is true. If its a “one-shot” emitter, emitting will switch to false after active emission cycle.

initial_direction: Vec2

Unit vector specifying emission direction.

initial_direction_spread: f32

Angle from 0 to “2 * Pi” for random fluctuation for direction vector.

initial_velocity: f32

Initial speed for each emitted particle. Direction of the initial speed vector is affected by “direction” and “spread”

initial_velocity_randomness: f32

Initial velocity randomness ratio. Each particle will spawned with “initial_velocity = initial_velocity - initial_velocity * rand::gen_range(0.0, initial_velocity_randomness)”.

linear_accel: f32

Velocity acceleration applied to each particle in the direction of motion.

size: f32

Each particle is a “size x size” square.

size_randomness: f32

Each particle will spawned with “size = size - size * rand::gen_range(0.0, size_randomness)”.

size_curve: Option<Curve>

If curve is present in each moment of particle lifetime size would be multiplied by the value from the curve

blend_mode: BlendMode

Particles rendering mode.

colors_curve: ColorCurve

How particles should change base color along the lifetime.

gravity: Vec2

Gravity applied to each individual particle.

texture: Option<Texture2D>

Particle texture. If none particles going to be white squares.

atlas: Option<AtlasConfig>

For animated texture specify spritesheet layout. If none the whole texture will be used.

material: Option<ParticleMaterial>

Custom material used to shade each particle.

post_processing: Option<PostProcessing>

If none particles will be rendered directly to the screen. If not none all the particles will be rendered to a rectangle and than this rectangle will be rendered to the screen. This will allows some effects affecting particles as a whole. NOTE: this is not really implemented and now Some will just make hardcoded downscaling

Trait Implementations

impl Clone for EmitterConfig[src]

impl Debug for EmitterConfig[src]

impl Default for EmitterConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.