Struct raui_tetra_renderer::simple_host::TetraSimpleHost [−][src]
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
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),
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.