Skip to main content

RaylibDrawable

Trait RaylibDrawable 

Source
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§

Source

fn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>)

Renders this command using context ctx.

Source

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§

Source

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

Source§

fn draw_frame( &mut self, render_commands: impl Iterator<Item = Box<dyn RaylibDrawable + 'b>>, )

Source§

impl<'b> CotisRendererAsync<Box<dyn RaylibDrawable + 'b>> for RaylibRender

Source§

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".

Implementations on Foreign Types§

Source§

impl RaylibDrawable for ClipEnd

Source§

fn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>)

Source§

fn scale_by(&mut self, _factor: f32)

Source§

impl<'a, E> RaylibDrawable for Border<'a, E>

Source§

fn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>)

Source§

fn scale_by(&mut self, factor: f32)

Source§

impl<'a, E> RaylibDrawable for ClipStart<'a, E>

Source§

fn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>)

Source§

fn scale_by(&mut self, factor: f32)

Source§

impl<'a, E> RaylibDrawable for Rectangle<'a, E>

Source§

fn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>)

Source§

fn scale_by(&mut self, factor: f32)

Source§

impl<'a, E> RaylibDrawable for Text<'a, E>

Source§

fn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>)

Source§

fn scale_by(&mut self, factor: f32)

Source§

impl<'a, I: GenericCompatibleImage, E> RaylibDrawable for Image<'a, I, E>

Source§

fn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>)

Source§

fn scale_by(&mut self, factor: f32)

Source§

fn preload_generic_images(&self, render: &mut RaylibRender)

Source§

impl<T: RaylibDrawable, L: RaylibDrawable + IsRenderList> RaylibDrawable for RenderTList<T, L>

Source§

fn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>)

Source§

fn scale_by(&mut self, factor: f32)

Source§

fn preload_generic_images(&self, render: &mut RaylibRender)

Source§

impl<T: RaylibDrawable> RaylibDrawable for RenderTList<T, ()>

Source§

fn draw(self: Box<Self>, ctx: &mut RaylibDrawContext<'_, '_>)

Source§

fn scale_by(&mut self, factor: f32)

Source§

fn preload_generic_images(&self, render: &mut RaylibRender)

Implementors§