Struct widgetry::widgets::just_draw::DrawWithTooltips [−][src]
pub struct DrawWithTooltips { draw: Drawable, tooltips: Vec<(Polygon, Text)>, hover: Box<dyn Fn(&Polygon) -> GeomBatch>, top_left: ScreenPt, dims: ScreenDims, }
Fields
draw: Drawable
tooltips: Vec<(Polygon, Text)>
hover: Box<dyn Fn(&Polygon) -> GeomBatch>
top_left: ScreenPt
dims: ScreenDims
Implementations
impl DrawWithTooltips
[src]
impl DrawWithTooltips
[src]pub fn new_widget(
ctx: &EventCtx<'_>,
batch: GeomBatch,
tooltips: Vec<(Polygon, Text)>,
hover: Box<dyn Fn(&Polygon) -> GeomBatch>
) -> Widget
[src]
ctx: &EventCtx<'_>,
batch: GeomBatch,
tooltips: Vec<(Polygon, Text)>,
hover: Box<dyn Fn(&Polygon) -> GeomBatch>
) -> Widget
batch
: the GeomBatch
to draw
tooltips
: (hitbox, text) tuples where each text
is shown when the user hovers over
the respective hitbox
hover
: returns a GeomBatch to render upon hovering. Return an GeomBox::new()
if
you want hovering to be a no-op
Trait Implementations
impl WidgetImpl for DrawWithTooltips
[src]
impl WidgetImpl for DrawWithTooltips
[src]