Struct suzy::platform::opengl::SlicedImage [−][src]
A common graphic used for user interfaces, a sliced image is defined by fixed-sized corners and an inner area which stretches to fill the graphic area.
See the Wikipedia article on 9-slice scaling for more information.
Implementations
impl SlicedImage
[src]
pub fn new() -> Self
[src]
Create a new SlicedImage.
pub fn set_image<P>(&mut self, texture: Texture, padding: &P) where
P: Padding2d,
[src]
P: Padding2d,
Set the texture used by this graphic. The given padding describes the sliced area.
Trait Implementations
impl Default for SlicedImage
[src]
impl Graphic<OpenGlRenderPlatform> for SlicedImage
[src]
fn draw(&mut self, ctx: &mut DrawContext<'_, OpenGlRenderPlatform>)
[src]
impl Rect for SlicedImage
[src]
fn x(&self) -> Dim
[src]
fn y(&self) -> Dim
[src]
fn x_mut<F, R>(&mut self, f: F) -> R where
F: FnOnce(&mut Dim) -> R,
[src]
F: FnOnce(&mut Dim) -> R,
fn y_mut<F, R>(&mut self, f: F) -> R where
F: FnOnce(&mut Dim) -> R,
[src]
F: FnOnce(&mut Dim) -> R,
fn left(&self) -> f32
[src]
fn set_left(&mut self, value: f32)
[src]
fn right(&self) -> f32
[src]
fn set_right(&mut self, value: f32)
[src]
fn bottom(&self) -> f32
[src]
fn set_bottom(&mut self, value: f32)
[src]
fn top(&self) -> f32
[src]
fn set_top(&mut self, value: f32)
[src]
fn center_x(&self) -> f32
[src]
fn set_center_x(&mut self, value: f32)
[src]
fn center_y(&self) -> f32
[src]
fn set_center_y(&mut self, value: f32)
[src]
fn center(&self) -> (f32, f32)
[src]
fn set_center(&mut self, value: (f32, f32))
[src]
fn width(&self) -> f32
[src]
fn set_width(&mut self, value: f32)
[src]
fn height(&self) -> f32
[src]
fn set_height(&mut self, value: f32)
[src]
fn pivot(&self) -> (f32, f32)
[src]
fn set_pivot(&mut self, value: (f32, f32))
[src]
fn pivot_pos(&self) -> (f32, f32)
[src]
fn set_pivot_pos(&mut self, value: (f32, f32))
[src]
fn area(&self) -> f32
[src]
fn aspect(&self) -> f32
[src]
fn contains(&self, point: (f32, f32)) -> bool
[src]
fn set_fill_width<R: ?Sized>(&mut self, other: &R, padding: Padding) where
R: Rect,
[src]
R: Rect,
fn set_fill_height<R: ?Sized>(&mut self, other: &R, padding: Padding) where
R: Rect,
[src]
R: Rect,
fn set_fill<R: ?Sized, P: ?Sized>(&mut self, other: &R, padding: &P) where
R: Rect,
P: Padding2d,
[src]
R: Rect,
P: Padding2d,
fn shrink_to_aspect(&mut self, aspect: f32)
[src]
fn grow_to_aspect(&mut self, aspect: f32)
[src]
fn surrounds<R: Rect + ?Sized>(&self, other: &R) -> bool
[src]
fn overlaps<R: Rect + ?Sized>(&self, other: &R) -> bool
[src]
Auto Trait Implementations
impl !RefUnwindSafe for SlicedImage
impl !Send for SlicedImage
impl !Sync for SlicedImage
impl Unpin for SlicedImage
impl !UnwindSafe for SlicedImage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DynRect for T where
T: Rect,
[src]
T: Rect,
pub fn x(&Self) -> Dim
[src]
pub fn y(&Self) -> Dim
[src]
pub fn x_mut(&mut Self, Box<dyn FnOnce(&mut Dim) + 'a, Global>)
[src]
pub fn y_mut(&mut Self, Box<dyn FnOnce(&mut Dim) + 'a, Global>)
[src]
pub fn set_left(&mut Self, f32)
[src]
pub fn set_right(&mut Self, f32)
[src]
pub fn set_bottom(&mut Self, f32)
[src]
pub fn set_top(&mut Self, f32)
[src]
pub fn set_center_x(&mut Self, f32)
[src]
pub fn set_center_y(&mut Self, f32)
[src]
pub fn set_center(&mut Self, (f32, f32))
[src]
pub fn set_width(&mut Self, f32)
[src]
pub fn set_height(&mut Self, f32)
[src]
pub fn set_pivot(&mut Self, (f32, f32))
[src]
pub fn set_pivot_pos(&mut Self, (f32, f32))
[src]
pub fn shrink_to_aspect(&mut Self, f32)
[src]
pub fn grow_to_aspect(&mut Self, f32)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,