pub struct Renderer {
pub quad_commands: Vec<QuadCommand>,
pub text_commands: Vec<TextCommand>,
pub text_measures: Vec<Vec<f32>>,
pub overlay_quad_commands: Vec<QuadCommand>,
pub overlay_text_commands: Vec<TextCommand>,
/* private fields */
}Fields§
§quad_commands: Vec<QuadCommand>§text_commands: Vec<TextCommand>§text_measures: Vec<Vec<f32>>Pixel widths measured by the render layer (indexed by TextCommand index).
Each entry corresponds to measure_chars of the same TextCommand.
overlay_quad_commands: Vec<QuadCommand>Overlay commands drawn on top of everything (for dropdowns, tooltips, etc.)
overlay_text_commands: Vec<TextCommand>Implementations§
Source§impl Renderer
impl Renderer
pub fn new() -> Self
pub fn clear(&mut self)
Sourcepub fn overlay_fill_rect_styled(
&mut self,
rect: (f32, f32, f32, f32),
color: [f32; 4],
border_radius: f32,
border_width: f32,
border_color: [f32; 4],
)
pub fn overlay_fill_rect_styled( &mut self, rect: (f32, f32, f32, f32), color: [f32; 4], border_radius: f32, border_width: f32, border_color: [f32; 4], )
Push a quad command to the overlay layer (drawn on top of everything).
Sourcepub fn overlay_draw_text(
&mut self,
text: &str,
pos: (f32, f32),
color: [u8; 3],
bounds: (f32, f32),
metrics: Metrics,
align: Align,
)
pub fn overlay_draw_text( &mut self, text: &str, pos: (f32, f32), color: [u8; 3], bounds: (f32, f32), metrics: Metrics, align: Align, )
Push a text command to the overlay layer (drawn on top of everything).
Sourcepub fn overlay_draw_text_with_font(
&mut self,
text: &str,
pos: (f32, f32),
color: [u8; 3],
bounds: (f32, f32),
metrics: Metrics,
align: Align,
font_family: &str,
)
pub fn overlay_draw_text_with_font( &mut self, text: &str, pos: (f32, f32), color: [u8; 3], bounds: (f32, f32), metrics: Metrics, align: Align, font_family: &str, )
Push a text command with font to the overlay layer.
pub fn push_clip(&mut self, clip: ClipRect)
pub fn pop_clip(&mut self)
pub fn fill_rect(&mut self, rect: (f32, f32, f32, f32), color: [f32; 3])
pub fn fill_rect_rounded( &mut self, rect: (f32, f32, f32, f32), color: [f32; 4], border_radius: f32, )
pub fn fill_rect_styled( &mut self, rect: (f32, f32, f32, f32), color: [f32; 4], border_radius: f32, border_width: f32, border_color: [f32; 4], )
pub fn draw_text( &mut self, text: &str, pos: (f32, f32), color: [u8; 3], bounds: (f32, f32), metrics: Metrics, align: Align, )
pub fn draw_text_with_font( &mut self, text: &str, pos: (f32, f32), color: [u8; 3], bounds: (f32, f32), metrics: Metrics, align: Align, font_family: &str, )
pub fn draw_text_measured( &mut self, text: &str, pos: (f32, f32), color: [u8; 3], bounds: (f32, f32), metrics: Metrics, align: Align, measure_chars: Vec<usize>, ) -> usize
Auto Trait Implementations§
impl Freeze for Renderer
impl RefUnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnwindSafe for Renderer
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.