Skip to main content

Script

Trait Script 

Source
pub trait Script: Send {
    // Provided methods
    fn init(&mut self, ctx: &impl Context) { ... }
    fn ready(&mut self, ctx: &impl Context) { ... }
    fn update(&mut self, ctx: &impl Context, delta: f32) { ... }
    fn event(&mut self, ctx: &impl Context, event: Event) { ... }
}

Provided Methods§

Source

fn init(&mut self, ctx: &impl Context)

Выполняется один раз во время загрузки файла библиотеки

Source

fn ready(&mut self, ctx: &impl Context)

Выполняется когда —

Source

fn update(&mut self, ctx: &impl Context, delta: f32)

Выполняется каждый main loop

Source

fn event(&mut self, ctx: &impl Context, event: Event)

Вызывается при вводе

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§