[−][src]Trait rask_wasm::graphics::GraphicsApi
Associated Types
type GraphicsError: Display
Required methods
fn new(width: u32, height: u32) -> Result<Self, ClientError>
Create a new graphics context.
width
and height
is the resolution of the pixelated image.
fn update_sprite_vector(
&mut self,
sprites: &[Sprite]
) -> Result<(), ClientError>
&mut self,
sprites: &[Sprite]
) -> Result<(), ClientError>
Update the sprite vector to the given slice of sprites.
fn upload_textures(
&mut self,
textures: &[(u32, u64, &Texture)]
) -> Result<(), ClientError>
&mut self,
textures: &[(u32, u64, &Texture)]
) -> Result<(), ClientError>
Upload the given id-to-texture mapping to the graphics context.
fn remove_textures(&mut self) -> Result<(), ClientError>
Remove all textures from the graphics context.
fn draw(&mut self) -> Result<(), ClientError>
Draw all sprites from the current sprite vector.
fn set_size(&mut self, w: u32, h: u32)
Force a canvas resizing to a given resolution.
fn update_size(&mut self, w: u32, h: u32)
Set the canvas size to given resolution. Do not update size if it has not changed.
fn ok(&self) -> Result<(), Self::GraphicsError>
Get the last graphics context error.
Implementors
impl GraphicsApi for WebGl2
[src]
type GraphicsError = WebGl2Error
fn new(width: u32, height: u32) -> Result<Self, ClientError>
[src]
fn update_sprite_vector(
&mut self,
sprites: &[Sprite]
) -> Result<(), ClientError>
[src]
&mut self,
sprites: &[Sprite]
) -> Result<(), ClientError>
fn upload_textures(
&mut self,
textures: &[(u32, u64, &Texture)]
) -> Result<(), ClientError>
[src]
&mut self,
textures: &[(u32, u64, &Texture)]
) -> Result<(), ClientError>