Trait winit::platform::web::CustomCursorExtWebSys

source ·
pub trait CustomCursorExtWebSys {
    // Required methods
    fn is_animation(&self) -> bool;
    fn from_url(
        url: String,
        hotspot_x: u16,
        hotspot_y: u16
    ) -> CustomCursorSource;
    fn from_animation(
        duration: Duration,
        cursors: Vec<CustomCursor>
    ) -> Result<CustomCursorSource, BadAnimation>;
}
Available on web_platform only.

Required Methods§

source

fn is_animation(&self) -> bool

Returns if this cursor is an animation.

source

fn from_url(url: String, hotspot_x: u16, hotspot_y: u16) -> CustomCursorSource

Creates a new cursor from a URL pointing to an image. It uses the url css function, but browser support for image formats is inconsistent. Using PNG is recommended.

source

fn from_animation( duration: Duration, cursors: Vec<CustomCursor> ) -> Result<CustomCursorSource, BadAnimation>

Crates a new animated cursor from multiple CustomCursors. Supplied cursors can’t be empty or other animations.

Object Safety§

This trait is not object safe.

Implementors§