Struct raui_tetra_renderer::simple_host::TetraSimpleHost
source · pub struct TetraSimpleHost {
pub application: Application,
pub resources: TetraResources,
pub interactions: TetraInteractionsEngine,
pub scaling: CoordsMappingScaling,
}
Expand description
A host that manages a RAUI application in a Tetra game
Fields§
§application: Application
§resources: TetraResources
§interactions: TetraInteractionsEngine
§scaling: CoordsMappingScaling
Implementations§
source§impl TetraSimpleHost
impl TetraSimpleHost
sourcepub fn new<'a, F, T, S>(
context: &mut Context,
tree: WidgetNode,
preload_fonts: F,
preload_textures: T,
setup: S
) -> Result<Self>where
F: IntoIterator<Item = &'a PreloadedFont<'a>>,
T: IntoIterator<Item = &'a PreloadedTexture<'a>>,
S: FnMut(&mut Application),
pub fn new<'a, F, T, S>( context: &mut Context, tree: WidgetNode, preload_fonts: F, preload_textures: T, setup: S ) -> Result<Self>where F: IntoIterator<Item = &'a PreloadedFont<'a>>, T: IntoIterator<Item = &'a PreloadedTexture<'a>>, S: FnMut(&mut Application),
Create a new TetraSimpleHost
Preloading Textures and Fonts
The preload_fonts
and preload_textures
parameters may be used to instruct the host to
load the given textures and fonts now before starting the app. Textures and fonts do not
have to be pre-loaded, in which case you would simply pass an empty slice ( &[]
) for each
argument.
If you do not wish to pre-load the textures and fonts, you may simply supply the path to the file when specifying images and fonts in the UI code and they will be loaded on-demand.
pub fn update(&mut self, context: &mut Context) -> Vec<Signal>
pub fn draw<L>(&mut self, context: &mut Context, logger: L) -> Resultwhere L: Logger,
pub fn event(&mut self, context: &mut Context, event: &Event)
Auto Trait Implementations§
impl !RefUnwindSafe for TetraSimpleHost
impl !Send for TetraSimpleHost
impl !Sync for TetraSimpleHost
impl Unpin for TetraSimpleHost
impl !UnwindSafe for TetraSimpleHost
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more