swamp_game_assets

Trait Assets

Source
pub trait Assets {
    // Required methods
    fn now(&self) -> Millis;
    fn material_png(&mut self, name: impl Into<AssetName>) -> MaterialRef;
    fn frame_fixed_grid_material_png(
        &mut self,
        name: impl Into<AssetName>,
        grid_size: UVec2,
        texture_size: UVec2,
    ) -> FixedAtlas;
    fn bm_font(&mut self, name: impl Into<AssetName>) -> FontAndMaterial;
    fn text_glyphs(
        &self,
        text: &str,
        font_and_mat: &FontAndMaterial,
    ) -> Option<Vec<Glyph>>;
    fn font(&self, font_ref: &Id<Font>) -> Option<&Font>;
    fn audio_sample_wav(
        &mut self,
        name: impl Into<AssetName>,
    ) -> StereoSampleRef;
}

Required Methods§

Source

fn now(&self) -> Millis

Source

fn material_png(&mut self, name: impl Into<AssetName>) -> MaterialRef

Source

fn frame_fixed_grid_material_png( &mut self, name: impl Into<AssetName>, grid_size: UVec2, texture_size: UVec2, ) -> FixedAtlas

Source

fn bm_font(&mut self, name: impl Into<AssetName>) -> FontAndMaterial

Source

fn text_glyphs( &self, text: &str, font_and_mat: &FontAndMaterial, ) -> Option<Vec<Glyph>>

Source

fn font(&self, font_ref: &Id<Font>) -> Option<&Font>

Source

fn audio_sample_wav(&mut self, name: impl Into<AssetName>) -> StereoSampleRef

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§