[−][src]Trait map_gui::AppLike
An application wishing to use the tools in this crate has to implement this on the struct that
implements widgetry::SharedAppState
, so that the tools here can access the map. See
SimpleApp
for an example implementation.
Required methods
fn map(&self) -> &Map
fn sim(&self) -> &Sim
fn cs(&self) -> &ColorScheme
fn mut_cs(&mut self) -> &mut ColorScheme
fn draw_map(&self) -> &DrawMap
fn mut_draw_map(&mut self) -> &mut DrawMap
fn opts(&self) -> &Options
fn mut_opts(&mut self) -> &mut Options
fn map_switched(
&mut self,
ctx: &mut EventCtx<'_>,
map: Map,
timer: &mut Timer<'_>
)
&mut self,
ctx: &mut EventCtx<'_>,
map: Map,
timer: &mut Timer<'_>
)
fn draw_with_opts(&self, g: &mut GfxCtx<'_>, opts: DrawOptions)
fn make_warper(
&mut self,
ctx: &EventCtx<'_>,
pt: Pt2D,
target_cam_zoom: Option<f64>,
id: Option<ID>
) -> Box<dyn State<Self>> where
Self: Sized,
&mut self,
ctx: &EventCtx<'_>,
pt: Pt2D,
target_cam_zoom: Option<f64>,
id: Option<ID>
) -> Box<dyn State<Self>> where
Self: Sized,
Create a widgetry::State
that warps to the given point.
Provided methods
fn sim_time(&self) -> Time
fn current_stage_and_remaining_time(
&self,
id: IntersectionID
) -> (usize, Duration)
&self,
id: IntersectionID
) -> (usize, Duration)
fn change_color_scheme(
&mut self,
ctx: &mut EventCtx<'_>,
cs: ColorSchemeChoice
) -> bool
&mut self,
ctx: &mut EventCtx<'_>,
cs: ColorSchemeChoice
) -> bool
Change the color scheme. Idempotent. Return true if there was a change.
Implementors
impl<T> AppLike for SimpleApp<T>
[src]
fn map(&self) -> &Map
[src]
fn sim(&self) -> &Sim
[src]
fn cs(&self) -> &ColorScheme
[src]
fn mut_cs(&mut self) -> &mut ColorScheme
[src]
fn draw_map(&self) -> &DrawMap
[src]
fn mut_draw_map(&mut self) -> &mut DrawMap
[src]
fn opts(&self) -> &Options
[src]
fn mut_opts(&mut self) -> &mut Options
[src]
fn map_switched(
&mut self,
ctx: &mut EventCtx<'_>,
map: Map,
timer: &mut Timer<'_>
)
[src]
&mut self,
ctx: &mut EventCtx<'_>,
map: Map,
timer: &mut Timer<'_>
)
fn draw_with_opts(&self, g: &mut GfxCtx<'_>, opts: DrawOptions)
[src]
fn make_warper(
&mut self,
ctx: &EventCtx<'_>,
pt: Pt2D,
target_cam_zoom: Option<f64>,
_: Option<ID>
) -> Box<dyn State<SimpleApp<T>>>
[src]
&mut self,
ctx: &EventCtx<'_>,
pt: Pt2D,
target_cam_zoom: Option<f64>,
_: Option<ID>
) -> Box<dyn State<SimpleApp<T>>>
fn sim_time(&self) -> Time
[src]
fn current_stage_and_remaining_time(
&self,
id: IntersectionID
) -> (usize, Duration)
[src]
&self,
id: IntersectionID
) -> (usize, Duration)