[][src]Struct pushrod_render::render::engine::Engine

pub struct Engine { /* fields omitted */ }

This is a storage container for the Pushrod event engine.

Implementations

impl Engine[src]

This is the heart of the Pushrod event engine, and is what is used to drive the interaction between the user and your application. The suggested method of use for this code is as follows:

Create a new object

Use Engine::new() to instantiate a new object.

Set up the base

Call engine.setup(width, height), by passing the width and height of the window that is being created for the main application. This is required, as a base widget is added to the render list. This BaseWidget is considered the parent of the application screen.

Add Widgets to the Engine

Call add_widget(Box::new(widget), "name".to_string()) to add your Widget to the managed display list.

Call Run()

Calling run(sdl, window) will manage the application screen after all widgets have been added to the display list.

That's all there is to it. If you want to see more interactions on how the Engine is used in an application, check out the demo test code, and look at rust-pushrod-chassis.

pub fn new() -> Self[src]

Creates a new Engine object.

pub fn setup(&mut self, window_width: u32, window_height: u32)[src]

Sets up the top-level widget so that other widgets can be added to the screen.

pub fn add_widget(
    &mut self,
    widget: Box<dyn Widget>,
    widget_name: String
) -> i32
[src]

Adds a widget to the display list. Widgets are rendered in the order in which they were created in the display list.

pub fn run(&mut self, sdl: Sdl, window: Window)[src]

Main application run loop, controls interaction between the user and the application.

Auto Trait Implementations

impl !RefUnwindSafe for Engine

impl !Send for Engine

impl !Sync for Engine

impl Unpin for Engine

impl !UnwindSafe for Engine

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.