pub struct Particle {Show 16 fields
pub textures: Vec<String>,
pub frames: Frames,
pub frame_speed: f32,
pub frame_settle: bool,
pub lifetime: Lifetime,
pub size: f32,
pub size_per_tick: f32,
pub alpha: f32,
pub fade: bool,
pub friction: f32,
pub gravity: f32,
pub gravity_needs_motion: bool,
pub physics: bool,
pub slide_when_blocked: bool,
pub random_roll: bool,
pub render: ParticleRender,
}Expand description
A .yparticle: everything but its id (its path).
Fields§
§textures: Vec<String>Its pictures, in order: the mod’s textures of the particles’ atlas
(@texture:mymod:particle/cloud).
frames: FramesWhich of them it shows.
frame_speed: f32How much faster than its life its frames go by age (Frames::Age).
frame_settle: boolOnce that faster run is past its life, its frames go by its age as it is (else they stay on the last).
lifetime: LifetimeTicks it lives: between min and max.
size: f32Its size, times the game’s particles’ (which varies a little).
size_per_tick: f32Its size times this each tick (1: it keeps it).
alpha: f32Its opacity at first (0–1).
fade: boolIt fades out over its life, from alpha to none.
friction: f32Its speed kept each tick.
gravity: f32Blocks a tick² it falls (negative: rises).
gravity_needs_motion: boolIt falls (gravity) only when spawned moving along every axis.
physics: boolIt meets blocks (it doesn’t go through them).
slide_when_blocked: boolIt speeds up sideways when something stops it rising or falling.
random_roll: boolIt starts turned at random (else upright).
render: ParticleRenderHow it’s drawn.
Trait Implementations§
Source§impl Schema for Particle
impl Schema for Particle
Source§fn encode(&self, __yog_w: &mut Writer)
fn encode(&self, __yog_w: &mut Writer)
Schema::write’s
value encoded, unless the type knows better (derived ones do).Source§fn pack(&self, __yog_p: &mut Packer)
fn pack(&self, __yog_p: &mut Packer)
crate::frame): its binary form as
bytes, unless the type packs itself (derived ones and plain types do).Source§fn unpack(__yog_u: &mut Unpacker<'_>) -> Option<Particle>
fn unpack(__yog_u: &mut Unpacker<'_>) -> Option<Particle>
None if the bytes aren’t what
Schema::pack writes.Source§fn read(v: &ValueRef<'_>, cx: &mut Reader<'_>) -> Option<Particle>
fn read(v: &ValueRef<'_>, cx: &mut Reader<'_>) -> Option<Particle>
v. Problems go to cx at its current path; None when the
value couldn’t be read (the problem is in cx).Source§fn absent() -> Option<Self>
fn absent() -> Option<Self>
None: the field is required.Source§fn decode(d: &mut Decoder<'_>) -> Option<Self>
fn decode(d: &mut Decoder<'_>) -> Option<Self>
None when it isn’t
what Schema::encode writes — then read_bytes reads the slow
way, which says what’s wrong. Through a value unless the type knows
better (derived ones do).Source§fn pack_list(items: &[Self], p: &mut Packer)
fn pack_list(items: &[Self], p: &mut Packer)
Source§fn encode_list(items: &[Self], w: &mut Writer)
fn encode_list(items: &[Self], w: &mut Writer)
impl StructuralPartialEq for Particle
Auto Trait Implementations§
impl Freeze for Particle
impl RefUnwindSafe for Particle
impl Send for Particle
impl Sync for Particle
impl Unpin for Particle
impl UnsafeUnpin for Particle
impl UnwindSafe for Particle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Message for Twhere
T: Schema,
impl<T> Message for Twhere
T: Schema,
Source§fn from_bytes(bytes: &[u8]) -> Option<Self>
fn from_bytes(bytes: &[u8]) -> Option<Self>
None if it isn’t one.Source§fn with_bytes<R>(&self, f: impl FnOnce(&[u8]) -> R) -> R
fn with_bytes<R>(&self, f: impl FnOnce(&[u8]) -> R) -> R
f on the payload, packed in this thread’s reused buffers: nothing
allocated once they’ve grown to the thread’s messages.