Struct pixel_widgets::draw::Image [−][src]
pub struct Image {
pub texture: usize,
pub texcoords: Rectangle,
pub size: Rectangle,
// some fields omitted
}Expand description
Reference to an image loaded by the Ui.
Fields
texture: usizeThe texture atlas identifier that this image resides in.
texcoords: RectangleThe texcoords within the atlas that the image spans.
size: RectangleThe physical size in pixels of the image.
Trait Implementations
impl<'a, T: 'a> IntoNode<'a, T> for &'a Image[src]
impl<'a, T: 'a> IntoNode<'a, T> for &'a Image[src]impl<'a, T: 'a> Widget<'a, T> for &'a Image[src]
impl<'a, T: 'a> Widget<'a, T> for &'a Image[src]fn widget(&self) -> &'static str[src]
fn widget(&self) -> &'static str[src]The name of this widget, used to identify widgets of this type in stylesheets.
fn len(&self) -> usize[src]
fn len(&self) -> usize[src]Should return the amount of children this widget has. Must be consistent with
visit_children(). Read more
fn visit_children(&mut self, _: &mut dyn FnMut(&mut Node<'a, T>))[src]
fn visit_children(&mut self, _: &mut dyn FnMut(&mut Node<'a, T>))[src]fn draw(
&mut self,
layout: Rectangle,
_: Rectangle,
style: &Stylesheet
) -> Vec<Primitive<'a>>[src]
fn draw(
&mut self,
layout: Rectangle,
_: Rectangle,
style: &Stylesheet
) -> Vec<Primitive<'a>>[src]Draw the widget. Returns a list of Primitives that should be drawn. Read more
fn state(&self) -> StateVec[src]
fn state(&self) -> StateVec[src]The state of this widget, used for computing the style.
If None is returned, Node will automatically compute a state, such as “hover” and “pressed”. Read more
fn is_empty(&self) -> bool[src]
fn is_empty(&self) -> bool[src]Returns whether this children has no children. Must be consistent with
visit_children(). Read more
fn hit(
&self,
layout: Rectangle,
clip: Rectangle,
_style: &Stylesheet,
x: f32,
y: f32
) -> bool[src]
fn hit(
&self,
layout: Rectangle,
clip: Rectangle,
_style: &Stylesheet,
x: f32,
y: f32
) -> bool[src]fn focused(&self) -> bool[src]
fn focused(&self) -> bool[src]Test the widget for focus exclusivity.
If the widget or one of it’s descendants is in an exclusive focus state, this function should return true.
In all other cases, it should return false. When a widget is in an exclusive focus state it is
the only widget that is allowed to receive events in event.
Widgets that intended to use this behaviour are modal dialogs, dropdown boxes, context menu’s, etc. Read more
fn event(
&mut self,
_layout: Rectangle,
_clip: Rectangle,
_style: &Stylesheet,
_event: Event,
_context: &mut Context<Message>
)[src]
fn event(
&mut self,
_layout: Rectangle,
_clip: Rectangle,
_style: &Stylesheet,
_event: Event,
_context: &mut Context<Message>
)[src]fn node_event(
&mut self,
_layout: Rectangle,
_style: &Stylesheet,
_event: NodeEvent,
_context: &mut Context<Message>
)[src]
fn node_event(
&mut self,
_layout: Rectangle,
_style: &Stylesheet,
_event: NodeEvent,
_context: &mut Context<Message>
)[src]Auto Trait Implementations
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for Timpl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> Any for T where
T: Any,
T: Any,
impl<T> CloneAny for T where
T: Any + Clone,
T: Any + Clone,