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

source

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.

source

pub fn update(&mut self, context: &mut Context) -> Vec<Signal>

source

pub fn draw<L>(&mut self, context: &mut Context, logger: L) -> Resultwhere L: Logger,

source

pub fn event(&mut self, context: &mut Context, event: &Event)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Finalize for T

§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.