pub struct GfxCtx<'a> {
pub(crate) inner: GfxCtxInnards<'a>,
uniforms: Uniforms,
screencap_mode: bool,
pub(crate) naming_hint: Option<String>,
pub canvas: &'a Canvas,
pub prerender: &'a Prerender,
style: &'a Style,
pub(crate) num_draw_calls: usize,
pub(crate) num_forks: usize,
}
Fields
inner: GfxCtxInnards<'a>
uniforms: Uniforms
screencap_mode: bool
naming_hint: Option<String>
canvas: &'a Canvas
prerender: &'a Prerender
style: &'a Style
num_draw_calls: usize
num_forks: usize
Implementations
sourceimpl<'a> GfxCtx<'a>
impl<'a> GfxCtx<'a>
pub(crate) fn new(
prerender: &'a Prerender,
canvas: &'a Canvas,
style: &'a Style,
screencap_mode: bool
) -> GfxCtx<'a>
pub fn fork(
&mut self,
top_left_map: Pt2D,
top_left_screen: ScreenPt,
zoom: f64,
z: Option<f32>
)
pub fn fork_screenspace(&mut self)
pub fn unfork(&mut self)
pub fn clear(&mut self, color: Color)
pub fn draw_polygon<T: Into<Tessellation>>(&mut self, color: Color, poly: T)
pub fn redraw(&mut self, obj: &Drawable)
pub fn redraw_at(&mut self, top_left: ScreenPt, obj: &Drawable)
pub fn enable_clipping(&mut self, rect: ScreenRectangle)
pub fn disable_clipping(&mut self)
sourcepub fn draw_mouse_tooltip(&mut self, txt: Text)
pub fn draw_mouse_tooltip(&mut self, txt: Text)
Draw a tooltip where the mouse is
sourcepub fn draw_tooltip_at(&mut self, txt: Text, center: ScreenPt)
pub fn draw_tooltip_at(&mut self, txt: Text, center: ScreenPt)
Draw a tooltip somewhere on the screen
pub fn get_screen_bounds(&self) -> Bounds
pub fn screen_to_map(&self, pt: ScreenPt) -> Pt2D
pub fn get_cursor_in_map_space(&self) -> Option<Pt2D>
pub(crate) fn get_num_uploads(&self) -> usize
pub fn is_screencap(&self) -> bool
pub fn set_screencap_naming_hint(&mut self, hint: String)
pub fn upload(&mut self, batch: GeomBatch) -> Drawable
pub fn default_line_height(&self) -> f64
pub fn style(&self) -> &Style
pub fn is_key_down(&self, key: Key) -> bool
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for GfxCtx<'a>
impl<'a> !Send for GfxCtx<'a>
impl<'a> !Sync for GfxCtx<'a>
impl<'a> Unpin for GfxCtx<'a>
impl<'a> !UnwindSafe for GfxCtx<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more