[−][src]Struct thyme::Context
The main Thyme Context that holds internal PersistentState
and is responsible for creating Frames
.
This is created by build
on
ContextBuilder
after resource registration is complete.
Implementations
impl Context
[src]
pub fn wants_mouse(&self) -> bool
[src]
Returns true if thyme wants to use the mouse in the current frame, generally because the mouse is over a Thyme widget. If this returns true, you probably want Thyme to handle input this frame, while if it returns false, your application or game logic should handle input.
pub fn add_theme_file<P: Into<PathBuf>>(&mut self, path: P)
[src]
Adds the specified path as a source file for the resources being used
by the theme for this context. This will only work if the theme was
set up to read source data from files, i.e. using
ContextBuilder#register_theme_from_files
This does not rebuild the theme; you will
need to call rebuild_all
for that.
pub fn remove_theme_file<P: Into<PathBuf>>(&mut self, path: P)
[src]
Removes the theme source file with the specified path from the resources
being used by the theme for this context, if it is present. If it is not
present, does nothing. This does not rebuild the theme; you will
need to call rebuild_all
for that.
pub fn rebuild_all<R: Renderer>(
&mut self,
renderer: &mut R
) -> Result<(), Error>
[src]
&mut self,
renderer: &mut R
) -> Result<(), Error>
Rebuilds this context, reloading all asset data. Notably, files on disk
that were used in building
the context
are re-read. If any errors are encountered in reading or parsing files, this
will return Err
and no changes are made to the context.
pub fn check_live_reload<R: Renderer>(
&mut self,
renderer: &mut R
) -> Result<(), Error>
[src]
&mut self,
renderer: &mut R
) -> Result<(), Error>
Checks the internal live reload thread to see if any file notifications have occurred
since the last check. If so, will fully rebuild the theme. If any errors are encountered
in the process of rebuilding the theme, will return the Err
and no changes are made to
the current theme. Note that if you built the context with live reload disabled
(see BuildOptions
), this function will do nothing.
pub fn create_frame(&mut self) -> Frame
[src]
Creates a Frame
, the main object that should pass through
your UI building functions and is responsible for constructing the widget tree.
This method should be called each frame you want to draw / interact with the UI.
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> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,