pub struct PlotImage { /* private fields */ }Expand description
An image in the plot.
Implementations§
Source§impl PlotImage
impl PlotImage
Sourcepub fn new(
name: impl Into<String>,
texture_id: impl Into<TextureId>,
center_position: PlotPoint,
size: impl Into<Vec2>,
) -> Self
pub fn new( name: impl Into<String>, texture_id: impl Into<TextureId>, center_position: PlotPoint, size: impl Into<Vec2>, ) -> Self
Create a new image with position and size in plot coordinates.
Sourcepub fn uv(self, uv: impl Into<Rect>) -> Self
pub fn uv(self, uv: impl Into<Rect>) -> Self
Select UV range. Default is (0,0) in top-left, (1,1) bottom right.
Sourcepub fn bg_fill(self, bg_fill: impl Into<Color32>) -> Self
pub fn bg_fill(self, bg_fill: impl Into<Color32>) -> Self
A solid color to put behind the image. Useful for transparent images.
Sourcepub fn tint(self, tint: impl Into<Color32>) -> Self
pub fn tint(self, tint: impl Into<Color32>) -> Self
Multiply image color with this. Default is WHITE (no tint).
Sourcepub fn rotate(self, angle: f64) -> Self
pub fn rotate(self, angle: f64) -> Self
Rotate the image counter-clockwise around its center by an angle in radians.
Sourcepub fn name(self, name: impl ToString) -> Self
pub fn name(self, name: impl ToString) -> Self
Name of this plot item.
This name will show up in the plot legend, if legends are turned on.
Setting the name via this method does not change the item’s id, so you can use it to
change the name dynamically between frames without losing the item’s state. You should
make sure the name passed to Self::new is unique and stable for each item, or
set unique and stable ids explicitly via Self::id.
Sourcepub fn highlight(self, highlight: bool) -> Self
pub fn highlight(self, highlight: bool) -> Self
Highlight this plot item, typically by scaling it up.
If false, the item may still be highlighted via user interaction.
Sourcepub fn allow_hover(self, hovering: bool) -> Self
pub fn allow_hover(self, hovering: bool) -> Self
Allowed hovering this item in the plot. Default: true.