pub struct RiveFacet { /* private fields */ }
Expand description
A facet constructed with the contents of a Rive animation file.
Implementations§
Source§impl RiveFacet
impl RiveFacet
Sourcepub fn new(size: Size, artboard: Object<Artboard>) -> Self
pub fn new(size: Size, artboard: Object<Artboard>) -> Self
Create a Rive facet with the contents of a Rive file.
Trait Implementations§
Source§impl Facet for RiveFacet
impl Facet for RiveFacet
Source§fn update_layers(
&mut self,
_size: Size,
layer_group: &mut dyn LayerGroup,
render_context: &mut RenderContext,
_view_context: &ViewAssistantContext,
) -> Result<(), Error>
fn update_layers( &mut self, _size: Size, layer_group: &mut dyn LayerGroup, render_context: &mut RenderContext, _view_context: &ViewAssistantContext, ) -> Result<(), Error>
Called by the scene on facets when it is time for them to update their contents.
Facets can add, remove or change layers in the layer group. Those layers will be
combined with all the other facet layers in the scene and added to a render
composition for display.
Source§fn calculate_size(&self, _available: Size) -> Size
fn calculate_size(&self, _available: Size) -> Size
Should return the current size needed by this facet.
Source§fn handle_message(&mut self, msg: Box<dyn Any>)
fn handle_message(&mut self, msg: Box<dyn Any>)
Method for receiving arbitrary message, like
SetColorMessage
or SetTextMessage
.Source§fn associate_facet_id(&mut self, facet_id: FacetId)
fn associate_facet_id(&mut self, facet_id: FacetId)
Optional method for facets that wish to send themselves messages using
an AppSender that they were passed during creation.
Auto Trait Implementations§
impl Freeze for RiveFacet
impl !RefUnwindSafe for RiveFacet
impl !Send for RiveFacet
impl !Sync for RiveFacet
impl Unpin for RiveFacet
impl !UnwindSafe for RiveFacet
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