pub struct VgaWriter { /* private fields */ }Implementations§
Source§impl VgaWriter
impl VgaWriter
Sourcepub fn set_rgb_color(&mut self, fg: RgbColor, bg: RgbColor)
pub fn set_rgb_color(&mut self, fg: RgbColor, bg: RgbColor)
Sets rgb color.
Sourcepub fn text_colors(&self) -> (RgbColor, RgbColor)
pub fn text_colors(&self) -> (RgbColor, RgbColor)
Performs the text colors operation.
Sourcepub fn glyph_size(&self) -> (usize, usize)
pub fn glyph_size(&self) -> (usize, usize)
Performs the glyph size operation.
Sourcepub fn set_cursor_cell(&mut self, col: usize, row: usize)
pub fn set_cursor_cell(&mut self, col: usize, row: usize)
Sets cursor cell.
Sourcepub fn framebuffer_info(&self) -> FramebufferInfo
pub fn framebuffer_info(&self) -> FramebufferInfo
Performs the framebuffer info operation.
Sourcepub fn set_clip_rect(&mut self, x: usize, y: usize, width: usize, height: usize)
pub fn set_clip_rect(&mut self, x: usize, y: usize, width: usize, height: usize)
Sets clip rect.
Sourcepub fn reset_clip_rect(&mut self)
pub fn reset_clip_rect(&mut self)
Performs the reset clip rect operation.
Sourcepub fn enable_double_buffer(&mut self) -> bool
pub fn enable_double_buffer(&mut self) -> bool
Enables double buffer.
Sourcepub fn disable_double_buffer(&mut self, present: bool)
pub fn disable_double_buffer(&mut self, present: bool)
Disables double buffer.
Sourcepub fn update_mouse_cursor(&mut self, x: i32, y: i32)
pub fn update_mouse_cursor(&mut self, x: i32, y: i32)
Updates mouse cursor.
Sourcepub fn hide_mouse_cursor(&mut self)
pub fn hide_mouse_cursor(&mut self)
Performs the hide mouse cursor operation.
Sourcepub fn pixel_to_sb_pos(&self, px: usize, py: usize) -> Option<(usize, usize)>
pub fn pixel_to_sb_pos(&self, px: usize, py: usize) -> Option<(usize, usize)>
Performs the pixel to sb pos operation.
Sourcepub fn start_selection(&mut self, px: usize, py: usize)
pub fn start_selection(&mut self, px: usize, py: usize)
Starts selection.
Sourcepub fn update_selection(&mut self, px: usize, py: usize)
pub fn update_selection(&mut self, px: usize, py: usize)
Updates selection.
Sourcepub fn end_selection(&mut self)
pub fn end_selection(&mut self)
Performs the end selection operation.
Sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Performs the clear selection operation.
Sourcepub fn clear_with(&mut self, color: RgbColor)
pub fn clear_with(&mut self, color: RgbColor)
Performs the clear with operation.
Sourcepub fn draw_pixel(&mut self, x: usize, y: usize, color: RgbColor)
pub fn draw_pixel(&mut self, x: usize, y: usize, color: RgbColor)
Performs the draw pixel operation.
Sourcepub fn draw_pixel_alpha(
&mut self,
x: usize,
y: usize,
color: RgbColor,
alpha: u8,
)
pub fn draw_pixel_alpha( &mut self, x: usize, y: usize, color: RgbColor, alpha: u8, )
Performs the draw pixel alpha operation.
Sourcepub fn draw_line(
&mut self,
x0: isize,
y0: isize,
x1: isize,
y1: isize,
color: RgbColor,
)
pub fn draw_line( &mut self, x0: isize, y0: isize, x1: isize, y1: isize, color: RgbColor, )
Performs the draw line operation.
Sourcepub fn draw_rect(
&mut self,
x: usize,
y: usize,
width: usize,
height: usize,
color: RgbColor,
)
pub fn draw_rect( &mut self, x: usize, y: usize, width: usize, height: usize, color: RgbColor, )
Performs the draw rect operation.
Sourcepub fn fill_rect(
&mut self,
x: usize,
y: usize,
width: usize,
height: usize,
color: RgbColor,
)
pub fn fill_rect( &mut self, x: usize, y: usize, width: usize, height: usize, color: RgbColor, )
Performs the fill rect operation.
Sourcepub fn fill_rect_alpha(
&mut self,
x: usize,
y: usize,
width: usize,
height: usize,
color: RgbColor,
alpha: u8,
)
pub fn fill_rect_alpha( &mut self, x: usize, y: usize, width: usize, height: usize, color: RgbColor, alpha: u8, )
Performs the fill rect alpha operation.
Sourcepub fn blit_rgb(
&mut self,
dst_x: usize,
dst_y: usize,
src_width: usize,
src_height: usize,
pixels: &[RgbColor],
) -> bool
pub fn blit_rgb( &mut self, dst_x: usize, dst_y: usize, src_width: usize, src_height: usize, pixels: &[RgbColor], ) -> bool
Performs the blit rgb operation.
Sourcepub fn blit_rgb24(
&mut self,
dst_x: usize,
dst_y: usize,
src_width: usize,
src_height: usize,
bytes: &[u8],
) -> bool
pub fn blit_rgb24( &mut self, dst_x: usize, dst_y: usize, src_width: usize, src_height: usize, bytes: &[u8], ) -> bool
Performs the blit rgb24 operation.
Sourcepub fn blit_rgba(
&mut self,
dst_x: usize,
dst_y: usize,
src_width: usize,
src_height: usize,
bytes: &[u8],
global_alpha: u8,
) -> bool
pub fn blit_rgba( &mut self, dst_x: usize, dst_y: usize, src_width: usize, src_height: usize, bytes: &[u8], global_alpha: u8, ) -> bool
Performs the blit rgba operation.
Sourcepub fn blit_sprite_rgba(
&mut self,
dst_x: usize,
dst_y: usize,
sprite: SpriteRgba<'_>,
global_alpha: u8,
) -> bool
pub fn blit_sprite_rgba( &mut self, dst_x: usize, dst_y: usize, sprite: SpriteRgba<'_>, global_alpha: u8, ) -> bool
Performs the blit sprite rgba operation.
Sourcepub fn draw_text_at(
&mut self,
pixel_x: usize,
pixel_y: usize,
text: &str,
fg: RgbColor,
bg: RgbColor,
)
pub fn draw_text_at( &mut self, pixel_x: usize, pixel_y: usize, text: &str, fg: RgbColor, bg: RgbColor, )
Performs the draw text at operation.
Sourcepub fn measure_text(
&self,
text: &str,
max_width: Option<usize>,
wrap: bool,
) -> TextMetrics
pub fn measure_text( &self, text: &str, max_width: Option<usize>, wrap: bool, ) -> TextMetrics
Performs the measure text operation.
Sourcepub fn draw_text(
&mut self,
pixel_x: usize,
pixel_y: usize,
text: &str,
opts: TextOptions,
) -> TextMetrics
pub fn draw_text( &mut self, pixel_x: usize, pixel_y: usize, text: &str, opts: TextOptions, ) -> TextMetrics
Performs the draw text operation.
Sourcepub fn draw_strata_stack(
&mut self,
origin_x: usize,
origin_y: usize,
layer_w: usize,
layer_h: usize,
)
pub fn draw_strata_stack( &mut self, origin_x: usize, origin_y: usize, layer_w: usize, layer_h: usize, )
Performs the draw strata stack operation.
Sourcepub fn scroll_view_up(&mut self, lines: usize)
pub fn scroll_view_up(&mut self, lines: usize)
Scroll the view up (backward in history) by lines lines.
Sourcepub fn scroll_view_down(&mut self, lines: usize)
pub fn scroll_view_down(&mut self, lines: usize)
Scroll the view down (forward, toward live) by lines lines.
Sourcepub fn scroll_to_live(&mut self)
pub fn scroll_to_live(&mut self)
Immediately return to the live (bottom) view.
Sourcepub fn scrollbar_click(&mut self, px_x: usize, px_y: usize)
pub fn scrollbar_click(&mut self, px_x: usize, px_y: usize)
Handle a click at pixel (px_x, px_y) — if it falls in the scrollbar,
jump the view to the corresponding scroll position.
Sourcepub fn scrollbar_drag_to(&mut self, px_y: usize)
pub fn scrollbar_drag_to(&mut self, px_y: usize)
Drag the scrollbar thumb to vertical pixel px_y.
Unlike scrollbar_click, this only depends on Y and is intended for
click-and-drag interactions where the pointer may slightly leave the
scrollbar strip horizontally.
Sourcepub fn scrollbar_hit_test(&self, px_x: usize, px_y: usize) -> bool
pub fn scrollbar_hit_test(&self, px_x: usize, px_y: usize) -> bool
Returns true if the pixel coordinates fall within the scrollbar strip.
Trait Implementations§
Source§impl Write for VgaWriter
impl Write for VgaWriter
impl Send for VgaWriter
Auto Trait Implementations§
impl Freeze for VgaWriter
impl RefUnwindSafe for VgaWriter
impl !Sync for VgaWriter
impl Unpin for VgaWriter
impl UnsafeUnpin for VgaWriter
impl UnwindSafe for VgaWriter
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more