pub struct PaxEngine<R: 'static + RenderContext> {
pub frames_elapsed: usize,
pub instance_registry: Rc<RefCell<InstanceRegistry<R>>>,
pub expression_table: HashMap<usize, Box<dyn Fn(ExpressionContext<'_, R>) -> TypesCoproduct>>,
pub main_component: Rc<RefCell<ComponentInstance<R>>>,
pub runtime: Rc<RefCell<Runtime<R>>>,
pub image_map: HashMap<Vec<u32>, (Box<Vec<u8>>, usize, usize)>,
/* private fields */
}Fields§
§frames_elapsed: usize§instance_registry: Rc<RefCell<InstanceRegistry<R>>>§expression_table: HashMap<usize, Box<dyn Fn(ExpressionContext<'_, R>) -> TypesCoproduct>>§main_component: Rc<RefCell<ComponentInstance<R>>>§runtime: Rc<RefCell<Runtime<R>>>§image_map: HashMap<Vec<u32>, (Box<Vec<u8>>, usize, usize)>Implementations§
source§impl<R: 'static + RenderContext> PaxEngine<R>
impl<R: 'static + RenderContext> PaxEngine<R>
pub fn new( main_component_instance: Rc<RefCell<ComponentInstance<R>>>, expression_table: HashMap<usize, Box<dyn Fn(ExpressionContext<'_, R>) -> TypesCoproduct>>, logger: PlatformSpecificLogger, viewport_size: (f64, f64), instance_registry: Rc<RefCell<InstanceRegistry<R>>> ) -> Self
sourcepub fn get_topmost_element_beneath_ray(
&self,
ray: (f64, f64)
) -> Option<Rc<RepeatExpandedNode<R>>>
pub fn get_topmost_element_beneath_ray( &self, ray: (f64, f64) ) -> Option<Rc<RepeatExpandedNode<R>>>
Simple 2D raycasting: the coordinates of the ray represent a
ray running orthogonally to the view plane, intersecting at
the specified point ray. Areas outside of clipping bounds will
not register a hit, nor will elements that suppress input events.
pub fn get_focused_element(&self) -> Option<Rc<RepeatExpandedNode<R>>>
sourcepub fn set_viewport_size(&mut self, new_viewport_size: (f64, f64))
pub fn set_viewport_size(&mut self, new_viewport_size: (f64, f64))
Called by chassis when viewport size changes, e.g. with native window resizes
sourcepub fn tick(&mut self, rcs: &mut HashMap<String, R>) -> Vec<NativeMessage>
pub fn tick(&mut self, rcs: &mut HashMap<String, R>) -> Vec<NativeMessage>
Workhorse method to advance rendering and property calculation by one discrete tick Will be executed synchronously up to 240 times/second.
pub fn load_image( &mut self, id_chain: Vec<u32>, image_data: Vec<u8>, width: usize, height: usize )
Auto Trait Implementations§
impl<R> !RefUnwindSafe for PaxEngine<R>
impl<R> !Send for PaxEngine<R>
impl<R> !Sync for PaxEngine<R>
impl<R> Unpin for PaxEngine<R>
impl<R> !UnwindSafe for PaxEngine<R>
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
source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.