Enum amethyst_ui::Anchor [−][src]
pub enum Anchor {
TopLeft,
TopMiddle,
TopRight,
MiddleLeft,
Middle,
MiddleRight,
BottomLeft,
BottomMiddle,
BottomRight,
}Indicated where the anchor is, relative to the parent (or to the screen, if there is no parent). Follow a normal english Y,X naming.
Variants
TopLeftAnchors the entity at the top left of the parent.
TopMiddleAnchors the entity at the top middle of the parent.
TopRightAnchors the entity at the top right of the parent.
MiddleLeftAnchors the entity at the middle left of the parent.
MiddleAnchors the entity at the center of the parent.
MiddleRightAnchors the entity at the middle right of the parent.
BottomLeftAnchors the entity at the bottom left of the parent.
BottomMiddleAnchors the entity at the bottom middle of the parent.
BottomRightAnchors the entity at the bottom right of the parent.
Methods
impl Anchor[src]
impl Anchorpub fn norm_offset(&self) -> (f32, f32)[src]
pub fn norm_offset(&self) -> (f32, f32)Returns the normalized offset using the Anchor setting.
The normalized offset is a [-0.5,0.5] value
indicating the relative offset from the parent's position (centered).
Trait Implementations
impl Debug for Anchor[src]
impl Debug for Anchorfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for Anchor[src]
impl Clone for Anchorfn clone(&self) -> Anchor[src]
fn clone(&self) -> AnchorReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Eq for Anchor[src]
impl Eq for Anchorimpl PartialEq for Anchor[src]
impl PartialEq for Anchor