Struct speedy2d::WebCanvas[][src]

pub struct WebCanvas<UserEventType = ()> where
    UserEventType: 'static, 
{ /* fields omitted */ }
Expand description

Struct representing an HTML canvas.

Implementations

Creates (and starts running) a new WebCanvas instance, attached to the HTML canvas with the specified ID. Event handlers will be registered for keyboard, mouse, and other events.

The event loop/handlers will continue to exist after the WebCanvas is dropped. This behaviour can be avoided using WebCanvas::unregister_when_dropped.

The provided WindowHandler will start to receive callbacks as soon as this function returns. Note that the main thread must not be blocked.

Creates (and starts running) a new WebCanvas instance, attached to the HTML canvas with the specified ID. Event handlers will be registered for keyboard, mouse, and other events.

This variant has support for user-generated events. See window::UserEventSender for more details.

The event loop/handlers will continue to exist after the WebCanvas is dropped. This behaviour can be avoided using WebCanvas::unregister_when_dropped.

The provided WindowHandler will start to receive callbacks as soon as this function returns. Note that the main thread must not be blocked.

Causes the WebCanvas event loop to terminate when the WebCanvas is dropped. If this function is not called, then the event loop (and associated event handlers) will continue to run after the WebCanvas struct is dropped.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.