[−][src]Struct egui::Context
Contains the input, style and output of all GUI commands.
Ui
:s keep an Arc pointer to this.
This allows us to create several child Ui
:s at once,
all working against the same shared Context.
Implementations
impl Context
[src]
pub fn new() -> Arc<Self>
[src]
pub fn rect(&self) -> Rect
[src]
pub fn memory(&self) -> MutexGuard<Memory>
[src]
pub fn graphics(&self) -> MutexGuard<GraphicLayers>
[src]
pub fn output(&self) -> MutexGuard<Output>
[src]
pub fn input(&self) -> &InputState
[src]
pub fn fonts(&self) -> &Fonts
[src]
Not valid until first call to begin_frame()
That's because since we don't know the proper pixels_per_point
until then.
pub fn texture(&self) -> &Texture
[src]
Not valid until first call to begin_frame()
That's because since we don't know the proper pixels_per_point
until then.
pub fn set_fonts(&self, font_definitions: FontDefinitions)
[src]
Will become active at the start of the next frame.
pixels_per_point
will be ignored (overwitten at start of each frame with the contents of input)
pub fn style(&self) -> Style
[src]
pub fn set_style(&self, style: Style)
[src]
pub fn pixels_per_point(&self) -> f32
[src]
pub fn round_to_pixel(&self, point: f32) -> f32
[src]
Useful for pixel-perfect rendering
pub fn round_pos_to_pixels(&self, pos: Pos2) -> Pos2
[src]
pub fn round_vec_to_pixels(&self, vec: Vec2) -> Vec2
[src]
pub fn round_rect_to_pixels(&self, rect: Rect) -> Rect
[src]
pub fn begin_frame(self: &mut Arc<Self>, new_input: RawInput) -> Ui
[src]
Call at the start of every frame. Returns a master fullscreen UI, covering the entire screen.
#[must_use]pub fn end_frame(&self) -> (Output, PaintBatches)
[src]
Call at the end of each frame.
Returns what has happened this frame (Output
) as well as what you need to paint.
pub fn make_unique_id<IdSource>(&self, source: IdSource, pos: Pos2) -> Id where
IdSource: Hash + Debug + Copy,
[src]
IdSource: Hash + Debug + Copy,
Generate a id from the given source. If it is not unique, an error will be printed at the given position.
pub fn register_unique_id(
&self,
id: Id,
source_name: impl Debug,
pos: Pos2
) -> Id
[src]
&self,
id: Id,
source_name: impl Debug,
pos: Pos2
) -> Id
If the given Id is not unique, an error will be printed at the given position.
pub fn contains_mouse(&self, layer: Layer, clip_rect: Rect, rect: Rect) -> bool
[src]
pub fn interact(
&self,
layer: Layer,
clip_rect: Rect,
rect: Rect,
interaction_id: Option<Id>,
sense: Sense
) -> InteractInfo
[src]
&self,
layer: Layer,
clip_rect: Rect,
rect: Rect,
interaction_id: Option<Id>,
sense: Sense
) -> InteractInfo
pub fn show_error(&self, pos: Pos2, text: impl Into<String>)
[src]
pub fn debug_text(&self, pos: Pos2, text: impl Into<String>)
[src]
pub fn debug_rect(&self, rect: Rect, name: impl Into<String>)
[src]
pub fn floating_text(
&self,
layer: Layer,
pos: Pos2,
text: String,
text_style: TextStyle,
align: (Align, Align),
text_color: Option<Color>
) -> Rect
[src]
&self,
layer: Layer,
pos: Pos2,
text: String,
text_style: TextStyle,
align: (Align, Align),
text_color: Option<Color>
) -> Rect
Show some text anywhere on screen.
To center the text at the given position, use align: (Center, Center)
.
pub fn add_galley(
&self,
layer: Layer,
pos: Pos2,
galley: Galley,
text_style: TextStyle,
color: Option<Color>
)
[src]
&self,
layer: Layer,
pos: Pos2,
galley: Galley,
text_style: TextStyle,
color: Option<Color>
)
Already layed out text.
pub fn add_paint_cmd(&self, layer: Layer, paint_cmd: PaintCmd)
[src]
impl Context
[src]
pub fn settings_ui(&self, ui: &mut Ui)
[src]
pub fn inspection_ui(&self, ui: &mut Ui)
[src]
pub fn memory_ui(&self, ui: &mut Ui)
[src]
impl Context
[src]
Trait Implementations
impl Clone for Context
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for Context
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,