pub trait RaylibDrawable {
// Required methods
fn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>);
fn scale_by(&mut self, factor: f32);
// Provided method
fn preload_generic_images(&self, _render: &mut RaylibRender) { ... }
}Expand description
Types that can be drawn by RaylibRender.
Required Methods§
Sourcefn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>)
fn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>)
Renders this command using context ctx.
Sourcefn scale_by(&mut self, factor: f32)
fn scale_by(&mut self, factor: f32)
Scales all positional and size data by factor in-place (not colors).
Used by RayTestRender for logical-resolution scaling.
Provided Methods§
Sourcefn preload_generic_images(&self, _render: &mut RaylibRender)
fn preload_generic_images(&self, _render: &mut RaylibRender)
Preloads path-based images into RaylibRender::image_cache.
Default no-op; RenderTList calls this before drawing.
Trait Implementations§
Source§impl<'b> CotisRenderer<Box<dyn RaylibDrawable + 'b>> for RaylibRender
impl<'b> CotisRenderer<Box<dyn RaylibDrawable + 'b>> for RaylibRender
fn draw_frame( &mut self, render_commands: impl Iterator<Item = Box<dyn RaylibDrawable + 'b>>, )
Source§impl<'b> CotisRendererAsync<Box<dyn RaylibDrawable + 'b>> for RaylibRender
impl<'b> CotisRendererAsync<Box<dyn RaylibDrawable + 'b>> for RaylibRender
async fn draw_frame( &mut self, render_commands: impl Iterator<Item = Box<dyn RaylibDrawable + 'b>>, )
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".