pub enum CustomCursorSource {
Image(CursorImage),
Animation(CursorAnimation),
Url {
hotspot_x: u16,
hotspot_y: u16,
url: String,
},
}Expand description
Source for CustomCursor.
See CustomCursor for more details.
Variants§
Image(CursorImage)
Cursor that is backed by RGBA image.
See CustomCursorSource::from_rgba for more.
§Platform-specific
- iOS / Android / Orbital: Unsupported
Animation(CursorAnimation)
Animated cursor.
See CustomCursorSource::from_animation for more.
§Platform-specific
- iOS / Android / Wayland / Windows / X11 / macOS / Orbital: Unsupported
Url
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.
§Platform-specific
- iOS / Android / Wayland / Windows / X11 / macOS / Orbital: Unsupported
Implementations§
Source§impl CustomCursorSource
impl CustomCursorSource
Sourcepub fn from_rgba(
rgba: Vec<u8>,
width: u16,
height: u16,
hotspot_x: u16,
hotspot_y: u16,
) -> Result<Self, BadImage>
pub fn from_rgba( rgba: Vec<u8>, width: u16, height: u16, hotspot_x: u16, hotspot_y: u16, ) -> Result<Self, BadImage>
Creates a new cursor from an rgba buffer.
The alpha channel is assumed to be not premultiplied.
Sourcepub fn from_animation(
duration: Duration,
cursors: Vec<CustomCursor>,
) -> Result<Self, BadAnimation>
pub fn from_animation( duration: Duration, cursors: Vec<CustomCursor>, ) -> Result<Self, BadAnimation>
Crates a new animated cursor from multiple CustomCursors
Supplied cursors can’t be empty or other animations.
Trait Implementations§
Source§impl Clone for CustomCursorSource
impl Clone for CustomCursorSource
Source§fn clone(&self) -> CustomCursorSource
fn clone(&self) -> CustomCursorSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CustomCursorSource
impl Debug for CustomCursorSource
Source§impl Hash for CustomCursorSource
impl Hash for CustomCursorSource
Source§impl PartialEq for CustomCursorSource
impl PartialEq for CustomCursorSource
impl Eq for CustomCursorSource
impl StructuralPartialEq for CustomCursorSource
Auto Trait Implementations§
impl Freeze for CustomCursorSource
impl !RefUnwindSafe for CustomCursorSource
impl Send for CustomCursorSource
impl Sync for CustomCursorSource
impl Unpin for CustomCursorSource
impl !UnwindSafe for CustomCursorSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more