pub struct HaloZone {
pub color: String,
pub x: f32,
pub y: f32,
pub radius: f32,
pub radius_x: Option<f32>,
pub radius_y: Option<f32>,
pub rotation: f32,
pub opacity: f32,
}Expand description
A single glow zone for the “halo” animated-background preset.
Fields§
§color: StringZone color (hex string). May itself carry an alpha channel
(#rrggbbaa); see HaloZone::opacity for how the two combine.
x: f32X position as a fraction of the surface the halo is painted on:
the viewport in a slide view, the world the camera travels in a
world view (WorldTimeline::world_extent). 0.0 = left, 1.0 = right.
y: f32Y position as a fraction of that same surface. 0.0 = top, 1.0 = bottom.
radius: f32Radius as a fraction of that surface’s max(width, height) — so the
same value covers proportionally the same area whichever view it is in.
This is also the fallback for radius_x/radius_y when either is
omitted, which is what keeps a zone written before those fields
existed a perfect, unrotated circle.
radius_x: Option<f32>Horizontal radius, same fraction-of-surface units as
HaloZone::radius. Omitted (the default) falls back to radius.
Set it together with radius_y to draw an ellipse instead of a
circle — a wide, thin light band wants radius_x far larger than
radius_y.
radius_y: Option<f32>Vertical radius, same fraction-of-surface units as
HaloZone::radius. Omitted (the default) falls back to radius —
see HaloZone::radius_x.
rotation: f32Rotation of the ellipse in degrees, clockwise about its own center.
Ignored on a circular zone (radius_x == radius_y, which includes
every zone that only sets radius) — a rotated circle is a circle,
so it is never worth the extra draw call.
opacity: f32Zone opacity, multiplied with any alpha already encoded in color.
Default 1.0 is a true no-op: it leaves color’s own alpha (opaque
or hex-encoded) untouched, so scenarios written before this field
existed — including ones that hid alpha inside the hex string, e.g.
#1E3A8A55 — keep rendering identically. Values are clamped to
0.0..=1.0.
Implementations§
Source§impl HaloZone
impl HaloZone
pub fn effective_radius_x(&self) -> f32
pub fn effective_radius_y(&self) -> f32
pub fn is_circular(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HaloZone
impl<'de> Deserialize<'de> for HaloZone
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for HaloZone
impl JsonSchema for HaloZone
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for HaloZone
impl RefUnwindSafe for HaloZone
impl Send for HaloZone
impl Sync for HaloZone
impl Unpin for HaloZone
impl UnsafeUnpin for HaloZone
impl UnwindSafe for HaloZone
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more