pub struct DrawBatch { /* private fields */ }
Expand description
Represents a batch of drawing commands, designed to be submitted together.
Implementations§
Source§impl DrawBatch
impl DrawBatch
Sourcepub fn submit(
&mut self,
z_order: usize,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub fn submit( &mut self, z_order: usize, ) -> Result<(), Box<dyn Error + Send + Sync>>
Submits a batch to the global drawing buffer, and empties the batch.
Sourcepub fn cls_color<COLOR>(&mut self, color: COLOR) -> &mut DrawBatch
pub fn cls_color<COLOR>(&mut self, color: COLOR) -> &mut DrawBatch
Adds a CLS (clear screen) to the drawing batch
Sourcepub fn target(&mut self, console: usize) -> &mut DrawBatch
pub fn target(&mut self, console: usize) -> &mut DrawBatch
Sets the target console for rendering
Sourcepub fn set<G>(
&mut self,
pos: Point,
color: ColorPair,
glyph: G,
) -> &mut DrawBatch
pub fn set<G>( &mut self, pos: Point, color: ColorPair, glyph: G, ) -> &mut DrawBatch
Sets an individual cell glyph
Sourcepub fn set_with_z<G>(
&mut self,
pos: Point,
color: ColorPair,
glyph: G,
z: u32,
) -> &mut DrawBatch
pub fn set_with_z<G>( &mut self, pos: Point, color: ColorPair, glyph: G, z: u32, ) -> &mut DrawBatch
Sets an individual cell glyph with a specified ordering within the batch
Sourcepub fn set_fancy<ANGLE, Z, G>(
&mut self,
position: Vec2,
z_order: Z,
rotation: ANGLE,
scale: Vec2,
color: ColorPair,
glyph: G,
) -> &mut DrawBatch
pub fn set_fancy<ANGLE, Z, G>( &mut self, position: Vec2, z_order: Z, rotation: ANGLE, scale: Vec2, color: ColorPair, glyph: G, ) -> &mut DrawBatch
Pushes a fancy terminal character
Sourcepub fn set_bg<COLOR>(&mut self, pos: Point, bg: COLOR) -> &mut DrawBatch
pub fn set_bg<COLOR>(&mut self, pos: Point, bg: COLOR) -> &mut DrawBatch
Sets an individual cell glyph
Sourcepub fn set_bg_with_z<COLOR>(
&mut self,
pos: Point,
bg: COLOR,
z: u32,
) -> &mut DrawBatch
pub fn set_bg_with_z<COLOR>( &mut self, pos: Point, bg: COLOR, z: u32, ) -> &mut DrawBatch
Sets an individual cell glyph with specified render order
Sourcepub fn printer<S>(
&mut self,
pos: Point,
text: S,
align: TextAlign,
background: Option<RGBA>,
) -> &mut DrawBatchwhere
S: ToString,
pub fn printer<S>(
&mut self,
pos: Point,
text: S,
align: TextAlign,
background: Option<RGBA>,
) -> &mut DrawBatchwhere
S: ToString,
Prints formatted text, using the doryen_rs convention. For example: “#[blue]This blue text contains a #[pink]pink#[] word”
Sourcepub fn printer_with_z<S>(
&mut self,
pos: Point,
text: S,
align: TextAlign,
background: Option<RGBA>,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
pub fn printer_with_z<S>(
&mut self,
pos: Point,
text: S,
align: TextAlign,
background: Option<RGBA>,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
Prints formatted text, using the doryen_rs convention. For example: “#[blue]This blue text contains a #[pink]pink#[] word” You can specify the render order.
Sourcepub fn print<S>(&mut self, pos: Point, text: S) -> &mut DrawBatchwhere
S: ToString,
pub fn print<S>(&mut self, pos: Point, text: S) -> &mut DrawBatchwhere
S: ToString,
Prints text in the default colors at a given location
Sourcepub fn print_with_z<S>(&mut self, pos: Point, text: S, z: u32) -> &mut DrawBatchwhere
S: ToString,
pub fn print_with_z<S>(&mut self, pos: Point, text: S, z: u32) -> &mut DrawBatchwhere
S: ToString,
Prints text in the default colors at a given location & render order
Sourcepub fn print_color<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
) -> &mut DrawBatchwhere
S: ToString,
pub fn print_color<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
) -> &mut DrawBatchwhere
S: ToString,
Prints text in the default colors at a given location
Sourcepub fn print_color_with_z<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
pub fn print_color_with_z<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
Prints text in the default colors at a given location & render order
Sourcepub fn print_centered<S, Y>(&mut self, y: Y, text: S) -> &mut DrawBatch
pub fn print_centered<S, Y>(&mut self, y: Y, text: S) -> &mut DrawBatch
Prints text, centered to the whole console width, at vertical location y.
Sourcepub fn print_centered_with_z<S, Y>(
&mut self,
y: Y,
text: S,
z: u32,
) -> &mut DrawBatch
pub fn print_centered_with_z<S, Y>( &mut self, y: Y, text: S, z: u32, ) -> &mut DrawBatch
Prints text, centered to the whole console width, at vertical location y.
Sourcepub fn print_color_centered<S, Y>(
&mut self,
y: Y,
text: S,
color: ColorPair,
) -> &mut DrawBatch
pub fn print_color_centered<S, Y>( &mut self, y: Y, text: S, color: ColorPair, ) -> &mut DrawBatch
Prints text, centered to the whole console width, at vertical location y.
Sourcepub fn print_color_centered_with_z<S, Y>(
&mut self,
y: Y,
text: S,
color: ColorPair,
z: u32,
) -> &mut DrawBatch
pub fn print_color_centered_with_z<S, Y>( &mut self, y: Y, text: S, color: ColorPair, z: u32, ) -> &mut DrawBatch
Prints text, centered to the whole console width, at vertical location y.
Sourcepub fn print_centered_at<S>(&mut self, pos: Point, text: S) -> &mut DrawBatchwhere
S: ToString,
pub fn print_centered_at<S>(&mut self, pos: Point, text: S) -> &mut DrawBatchwhere
S: ToString,
Prints text, centered to the whole console width, at vertical location y.
Sourcepub fn print_centered_at_with_z<S>(
&mut self,
pos: Point,
text: S,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
pub fn print_centered_at_with_z<S>(
&mut self,
pos: Point,
text: S,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
Prints text, centered to the whole console width, at vertical location y with render order.
Sourcepub fn print_color_centered_at<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
) -> &mut DrawBatchwhere
S: ToString,
pub fn print_color_centered_at<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
) -> &mut DrawBatchwhere
S: ToString,
Prints text, centered to the whole console width, at vertical location y.
Sourcepub fn print_color_centered_at_with_z<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
pub fn print_color_centered_at_with_z<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
Prints text, centered to the whole console width, at vertical location y with render order.
Sourcepub fn print_right<S>(&mut self, pos: Point, text: S) -> &mut DrawBatchwhere
S: ToString,
pub fn print_right<S>(&mut self, pos: Point, text: S) -> &mut DrawBatchwhere
S: ToString,
Prints right aligned text
Sourcepub fn print_right_z<S>(
&mut self,
pos: Point,
text: S,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
pub fn print_right_z<S>(
&mut self,
pos: Point,
text: S,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
Prints right aligned text with render order
Sourcepub fn print_color_right<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
) -> &mut DrawBatchwhere
S: ToString,
pub fn print_color_right<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
) -> &mut DrawBatchwhere
S: ToString,
Prints right aligned text
Sourcepub fn print_color_right_with_z<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
pub fn print_color_right_with_z<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32,
) -> &mut DrawBatchwhere
S: ToString,
Prints right aligned text with render order
Sourcepub fn draw_box(&mut self, pos: Rect, color: ColorPair) -> &mut DrawBatch
pub fn draw_box(&mut self, pos: Rect, color: ColorPair) -> &mut DrawBatch
Draws a box, starting at x/y with the extents width/height using CP437 line characters
Sourcepub fn draw_box_with_z(
&mut self,
pos: Rect,
color: ColorPair,
z: u32,
) -> &mut DrawBatch
pub fn draw_box_with_z( &mut self, pos: Rect, color: ColorPair, z: u32, ) -> &mut DrawBatch
Draws a box, starting at x/y with the extents width/height using CP437 line characters. With render order.
Sourcepub fn draw_hollow_box(&mut self, pos: Rect, color: ColorPair) -> &mut DrawBatch
pub fn draw_hollow_box(&mut self, pos: Rect, color: ColorPair) -> &mut DrawBatch
Draws a non-filled (hollow) box, starting at x/y with the extents width/height using CP437 line characters
Sourcepub fn draw_hollow_box_with_z(
&mut self,
pos: Rect,
color: ColorPair,
z: u32,
) -> &mut DrawBatch
pub fn draw_hollow_box_with_z( &mut self, pos: Rect, color: ColorPair, z: u32, ) -> &mut DrawBatch
Draws a non-filled (hollow) box, starting at x/y with the extents width/height using CP437 line characters. With render order.
Sourcepub fn draw_double_box(&mut self, pos: Rect, color: ColorPair) -> &mut DrawBatch
pub fn draw_double_box(&mut self, pos: Rect, color: ColorPair) -> &mut DrawBatch
Draws a double-lined box, starting at x/y with the extents width/height using CP437 line characters
Sourcepub fn draw_double_box_with_z(
&mut self,
pos: Rect,
color: ColorPair,
z: u32,
) -> &mut DrawBatch
pub fn draw_double_box_with_z( &mut self, pos: Rect, color: ColorPair, z: u32, ) -> &mut DrawBatch
Draws a double-lined box, starting at x/y with the extents width/height using CP437 line characters
Sourcepub fn draw_hollow_double_box(
&mut self,
pos: Rect,
color: ColorPair,
) -> &mut DrawBatch
pub fn draw_hollow_double_box( &mut self, pos: Rect, color: ColorPair, ) -> &mut DrawBatch
Draws a non-filled (hollow) double-lined box, starting at x/y with the extents width/height using CP437 line characters
Sourcepub fn draw_hollow_double_box_with_z(
&mut self,
pos: Rect,
color: ColorPair,
z: u32,
) -> &mut DrawBatch
pub fn draw_hollow_double_box_with_z( &mut self, pos: Rect, color: ColorPair, z: u32, ) -> &mut DrawBatch
Draws a non-filled (hollow) double-lined box, starting at x/y with the extents width/height using CP437 line characters
Sourcepub fn fill_region<G>(
&mut self,
pos: Rect,
color: ColorPair,
glyph: G,
) -> &mut DrawBatch
pub fn fill_region<G>( &mut self, pos: Rect, color: ColorPair, glyph: G, ) -> &mut DrawBatch
Fills a region with a glyph/color combination.
Sourcepub fn fill_region_with_z<G>(
&mut self,
pos: Rect,
color: ColorPair,
glyph: G,
z: u32,
) -> &mut DrawBatch
pub fn fill_region_with_z<G>( &mut self, pos: Rect, color: ColorPair, glyph: G, z: u32, ) -> &mut DrawBatch
Fills a region with a glyph/color combination.
Sourcepub fn bar_horizontal<W, N, MAX>(
&mut self,
pos: Point,
width: W,
n: N,
max: MAX,
color: ColorPair,
) -> &mut DrawBatch
pub fn bar_horizontal<W, N, MAX>( &mut self, pos: Point, width: W, n: N, max: MAX, color: ColorPair, ) -> &mut DrawBatch
Draw a horizontal progress bar
Sourcepub fn bar_horizontal_with_z<W, N, MAX>(
&mut self,
pos: Point,
width: W,
n: N,
max: MAX,
color: ColorPair,
z: u32,
) -> &mut DrawBatch
pub fn bar_horizontal_with_z<W, N, MAX>( &mut self, pos: Point, width: W, n: N, max: MAX, color: ColorPair, z: u32, ) -> &mut DrawBatch
Draw a horizontal progress bar
Sourcepub fn bar_vertical<H, N, MAX>(
&mut self,
pos: Point,
height: H,
n: N,
max: MAX,
color: ColorPair,
) -> &mut DrawBatch
pub fn bar_vertical<H, N, MAX>( &mut self, pos: Point, height: H, n: N, max: MAX, color: ColorPair, ) -> &mut DrawBatch
Draw a horizontal progress bar
Sourcepub fn bar_vertical_with_z<H, N, MAX>(
&mut self,
pos: Point,
height: H,
n: N,
max: MAX,
color: ColorPair,
z: u32,
) -> &mut DrawBatch
pub fn bar_vertical_with_z<H, N, MAX>( &mut self, pos: Point, height: H, n: N, max: MAX, color: ColorPair, z: u32, ) -> &mut DrawBatch
Draw a horizontal progress bar
Sourcepub fn set_clipping(&mut self, clip: Option<Rect>) -> &mut DrawBatch
pub fn set_clipping(&mut self, clip: Option<Rect>) -> &mut DrawBatch
Sets a clipping rectangle for the current console
Sourcepub fn set_all_fg_alpha(&mut self, alpha: f32) -> &mut DrawBatch
pub fn set_all_fg_alpha(&mut self, alpha: f32) -> &mut DrawBatch
Apply an alpha channel value to all cells’ foregrounds in the current terminal.
Sourcepub fn set_all_bg_alpha(&mut self, alpha: f32) -> &mut DrawBatch
pub fn set_all_bg_alpha(&mut self, alpha: f32) -> &mut DrawBatch
Apply an alpha channel value to all cells’ backgrounds in the current terminal.
Sourcepub fn set_all_alpha(&mut self, fg: f32, bg: f32) -> &mut DrawBatch
pub fn set_all_alpha(&mut self, fg: f32, bg: f32) -> &mut DrawBatch
Apply fg/bg alpha channel values to all cells in the current terminal.