pub enum Axis {
Down,
Up,
Left,
Right,
}Expand description
Which way an effect sweeps across the window.
The axis a genie was hardcoded to before this crate existed, which is why a
dock down the side of the screen was inexpressible: (1.0 - v) is down
and nothing else. Named for the direction the window is pulled, so the
edge nearest the dock is the edge that leads.
Variants§
Down
Pulled downwards: the bottom edge leads. A dock along the bottom, and the default because that is the dock everybody has seen.
Up
Pulled upwards: the top edge leads. A bar along the top.
Left
Pulled to the left: the left edge leads. A dock down the left side.
Right
Pulled to the right: the right edge leads.
Implementations§
Source§impl Axis
impl Axis
Sourcepub fn phase(self, u: f64, v: f64) -> f64
pub fn phase(self, u: f64, v: f64) -> f64
How far through the sweep the point at (u, v) is.
0 leads and 1 follows, so a point at phase 0 has finished its journey before a point at phase 1 has started one. That lag is the whole difference between a genie and a shrink.
Sourcepub fn horizontal(self) -> bool
pub fn horizontal(self) -> bool
Whether the sweep runs across the window rather than down it.
What Deform::segments turns the grid by. A window cut into 48 rows
and 8 columns has 48 steps of phase for a dock at the bottom and eight
for one at the side – which is not a subtler genie, it is a flipbook.
Sourcepub fn all() -> [(&'static str, Self); 4]
pub fn all() -> [(&'static str, Self); 4]
Every axis, for tools that want to show them all and for the check that the shipped Lua only names ones that exist.