swamp_render::api

Trait Gfx

Source
pub trait Gfx {
    // Required methods
    fn set_origo(&mut self, position: Vec2);
    fn sprite_atlas_frame(
        &mut self,
        position: Vec3,
        frame: u16,
        atlas: &impl FrameLookup,
    );
    fn sprite_atlas(
        &mut self,
        position: Vec3,
        atlas_rect: URect,
        material: &MaterialRef,
    );
    fn text_draw(
        &mut self,
        position: Vec3,
        text: &str,
        font_ref: &FontAndMaterialRef,
    );
    fn text_glyphs(
        &mut self,
        position: Vec2,
        text: &str,
        font_ref: &FontAndMaterialRef,
    ) -> Vec<Glyph>;
    fn tilemap(
        &mut self,
        position: Vec3,
        tiles: &[u16],
        width: u16,
        atlas: &FixedAtlas,
    );
    fn now(&self) -> Millis;
}

Required Methods§

Source

fn set_origo(&mut self, position: Vec2)

Source

fn sprite_atlas_frame( &mut self, position: Vec3, frame: u16, atlas: &impl FrameLookup, )

Source

fn sprite_atlas( &mut self, position: Vec3, atlas_rect: URect, material: &MaterialRef, )

Source

fn text_draw( &mut self, position: Vec3, text: &str, font_ref: &FontAndMaterialRef, )

Source

fn text_glyphs( &mut self, position: Vec2, text: &str, font_ref: &FontAndMaterialRef, ) -> Vec<Glyph>

Source

fn tilemap( &mut self, position: Vec3, tiles: &[u16], width: u16, atlas: &FixedAtlas, )

Source

fn now(&self) -> Millis

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§