Struct bracket_terminal::prelude::DrawBatch
source · [−]pub struct DrawBatch { /* private fields */ }
Expand description
Represents a batch of drawing commands, designed to be submitted together.
Implementations
sourceimpl DrawBatch
impl DrawBatch
sourcepub fn submit(&mut self, z_order: usize) -> BResult<()>
pub fn submit(&mut self, z_order: usize) -> BResult<()>
Submits a batch to the global drawing buffer, and empties the batch.
sourcepub fn cls_color<COLOR>(&mut self, color: COLOR) -> &mut Selfwhere
COLOR: Into<RGBA>,
pub fn cls_color<COLOR>(&mut self, color: COLOR) -> &mut Selfwhere
COLOR: Into<RGBA>,
Adds a CLS (clear screen) to the drawing batch
sourcepub fn set<G: TryInto<FontCharType>>(
&mut self,
pos: Point,
color: ColorPair,
glyph: G
) -> &mut Self
pub fn set<G: TryInto<FontCharType>>(
&mut self,
pos: Point,
color: ColorPair,
glyph: G
) -> &mut Self
Sets an individual cell glyph
sourcepub fn set_with_z<G: TryInto<FontCharType>>(
&mut self,
pos: Point,
color: ColorPair,
glyph: G,
z: u32
) -> &mut Self
pub fn set_with_z<G: TryInto<FontCharType>>(
&mut self,
pos: Point,
color: ColorPair,
glyph: G,
z: u32
) -> &mut Self
Sets an individual cell glyph with a specified ordering within the batch
sourcepub fn set_fancy<ANGLE: Into<Radians>, Z: TryInto<i32>, G: TryInto<FontCharType>>(
&mut self,
position: PointF,
z_order: Z,
rotation: ANGLE,
scale: PointF,
color: ColorPair,
glyph: G
) -> &mut Self
pub fn set_fancy<ANGLE: Into<Radians>, Z: TryInto<i32>, G: TryInto<FontCharType>>(
&mut self,
position: PointF,
z_order: Z,
rotation: ANGLE,
scale: PointF,
color: ColorPair,
glyph: G
) -> &mut Self
Pushes a fancy terminal character
sourcepub fn set_bg<COLOR>(&mut self, pos: Point, bg: COLOR) -> &mut Selfwhere
COLOR: Into<RGBA>,
pub fn set_bg<COLOR>(&mut self, pos: Point, bg: COLOR) -> &mut Selfwhere
COLOR: Into<RGBA>,
Sets an individual cell glyph
sourcepub fn set_bg_with_z<COLOR>(&mut self, pos: Point, bg: COLOR, z: u32) -> &mut Selfwhere
COLOR: Into<RGBA>,
pub fn set_bg_with_z<COLOR>(&mut self, pos: Point, bg: COLOR, z: u32) -> &mut Selfwhere
COLOR: Into<RGBA>,
Sets an individual cell glyph with specified render order
sourcepub fn printer<S: ToString>(
&mut self,
pos: Point,
text: S,
align: TextAlign,
background: Option<RGBA>
) -> &mut Self
pub fn printer<S: ToString>(
&mut self,
pos: Point,
text: S,
align: TextAlign,
background: Option<RGBA>
) -> &mut Self
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: ToString>(
&mut self,
pos: Point,
text: S,
align: TextAlign,
background: Option<RGBA>,
z: u32
) -> &mut Self
pub fn printer_with_z<S: ToString>(
&mut self,
pos: Point,
text: S,
align: TextAlign,
background: Option<RGBA>,
z: u32
) -> &mut Self
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: ToString>(&mut self, pos: Point, text: S) -> &mut Self
pub fn print<S: ToString>(&mut self, pos: Point, text: S) -> &mut Self
Prints text in the default colors at a given location
sourcepub fn print_with_z<S: ToString>(
&mut self,
pos: Point,
text: S,
z: u32
) -> &mut Self
pub fn print_with_z<S: ToString>(
&mut self,
pos: Point,
text: S,
z: u32
) -> &mut Self
Prints text in the default colors at a given location & render order
sourcepub fn print_color<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair
) -> &mut Self
pub fn print_color<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair
) -> &mut Self
Prints text in the default colors at a given location
sourcepub fn print_color_with_z<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32
) -> &mut Self
pub fn print_color_with_z<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32
) -> &mut Self
Prints text in the default colors at a given location & render order
sourcepub fn print_centered<S: ToString, Y: TryInto<i32>>(
&mut self,
y: Y,
text: S
) -> &mut Self
pub fn print_centered<S: ToString, Y: TryInto<i32>>(
&mut self,
y: Y,
text: S
) -> &mut Self
Prints text, centered to the whole console width, at vertical location y.
sourcepub fn print_centered_with_z<S: ToString, Y: TryInto<i32>>(
&mut self,
y: Y,
text: S,
z: u32
) -> &mut Self
pub fn print_centered_with_z<S: ToString, Y: TryInto<i32>>(
&mut self,
y: Y,
text: S,
z: u32
) -> &mut Self
Prints text, centered to the whole console width, at vertical location y.
sourcepub fn print_color_centered<S: ToString, Y: TryInto<i32>>(
&mut self,
y: Y,
text: S,
color: ColorPair
) -> &mut Self
pub fn print_color_centered<S: ToString, Y: TryInto<i32>>(
&mut self,
y: Y,
text: S,
color: ColorPair
) -> &mut Self
Prints text, centered to the whole console width, at vertical location y.
sourcepub fn print_color_centered_with_z<S: ToString, Y: TryInto<i32>>(
&mut self,
y: Y,
text: S,
color: ColorPair,
z: u32
) -> &mut Self
pub fn print_color_centered_with_z<S: ToString, Y: TryInto<i32>>(
&mut self,
y: Y,
text: S,
color: ColorPair,
z: u32
) -> &mut Self
Prints text, centered to the whole console width, at vertical location y.
sourcepub fn print_centered_at<S: ToString>(&mut self, pos: Point, text: S) -> &mut Self
pub fn print_centered_at<S: ToString>(&mut self, pos: Point, text: S) -> &mut Self
Prints text, centered to the whole console width, at vertical location y.
sourcepub fn print_centered_at_with_z<S: ToString>(
&mut self,
pos: Point,
text: S,
z: u32
) -> &mut Self
pub fn print_centered_at_with_z<S: ToString>(
&mut self,
pos: Point,
text: S,
z: u32
) -> &mut Self
Prints text, centered to the whole console width, at vertical location y with render order.
sourcepub fn print_color_centered_at<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair
) -> &mut Self
pub fn print_color_centered_at<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair
) -> &mut Self
Prints text, centered to the whole console width, at vertical location y.
sourcepub fn print_color_centered_at_with_z<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32
) -> &mut Self
pub fn print_color_centered_at_with_z<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32
) -> &mut Self
Prints text, centered to the whole console width, at vertical location y with render order.
sourcepub fn print_right<S: ToString>(&mut self, pos: Point, text: S) -> &mut Self
pub fn print_right<S: ToString>(&mut self, pos: Point, text: S) -> &mut Self
Prints right aligned text
sourcepub fn print_right_z<S: ToString>(
&mut self,
pos: Point,
text: S,
z: u32
) -> &mut Self
pub fn print_right_z<S: ToString>(
&mut self,
pos: Point,
text: S,
z: u32
) -> &mut Self
Prints right aligned text with render order
sourcepub fn print_color_right<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair
) -> &mut Self
pub fn print_color_right<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair
) -> &mut Self
Prints right aligned text
sourcepub fn print_color_right_with_z<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32
) -> &mut Self
pub fn print_color_right_with_z<S: ToString>(
&mut self,
pos: Point,
text: S,
color: ColorPair,
z: u32
) -> &mut Self
Prints right aligned text with render order
sourcepub fn draw_box(&mut self, pos: Rect, color: ColorPair) -> &mut Self
pub fn draw_box(&mut self, pos: Rect, color: ColorPair) -> &mut Self
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 Self
pub fn draw_box_with_z(&mut self, pos: Rect, color: ColorPair, z: u32) -> &mut Self
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 Self
pub fn draw_hollow_box(&mut self, pos: Rect, color: ColorPair) -> &mut Self
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 Self
pub fn draw_hollow_box_with_z(
&mut self,
pos: Rect,
color: ColorPair,
z: u32
) -> &mut Self
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 Self
pub fn draw_double_box(&mut self, pos: Rect, color: ColorPair) -> &mut Self
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 Self
pub fn draw_double_box_with_z(
&mut self,
pos: Rect,
color: ColorPair,
z: u32
) -> &mut Self
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 Self
pub fn draw_hollow_double_box(&mut self, pos: Rect, color: ColorPair) -> &mut Self
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 Self
pub fn draw_hollow_double_box_with_z(
&mut self,
pos: Rect,
color: ColorPair,
z: u32
) -> &mut Self
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: TryInto<FontCharType>>(
&mut self,
pos: Rect,
color: ColorPair,
glyph: G
) -> &mut Self
pub fn fill_region<G: TryInto<FontCharType>>(
&mut self,
pos: Rect,
color: ColorPair,
glyph: G
) -> &mut Self
Fills a region with a glyph/color combination.
sourcepub fn fill_region_with_z<G: TryInto<FontCharType>>(
&mut self,
pos: Rect,
color: ColorPair,
glyph: G,
z: u32
) -> &mut Self
pub fn fill_region_with_z<G: TryInto<FontCharType>>(
&mut self,
pos: Rect,
color: ColorPair,
glyph: G,
z: u32
) -> &mut Self
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 Selfwhere
W: TryInto<i32>,
N: TryInto<i32>,
MAX: TryInto<i32>,
pub fn bar_horizontal<W, N, MAX>(
&mut self,
pos: Point,
width: W,
n: N,
max: MAX,
color: ColorPair
) -> &mut Selfwhere
W: TryInto<i32>,
N: TryInto<i32>,
MAX: TryInto<i32>,
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 Selfwhere
W: TryInto<i32>,
N: TryInto<i32>,
MAX: TryInto<i32>,
pub fn bar_horizontal_with_z<W, N, MAX>(
&mut self,
pos: Point,
width: W,
n: N,
max: MAX,
color: ColorPair,
z: u32
) -> &mut Selfwhere
W: TryInto<i32>,
N: TryInto<i32>,
MAX: TryInto<i32>,
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 Selfwhere
H: TryInto<i32>,
N: TryInto<i32>,
MAX: TryInto<i32>,
pub fn bar_vertical<H, N, MAX>(
&mut self,
pos: Point,
height: H,
n: N,
max: MAX,
color: ColorPair
) -> &mut Selfwhere
H: TryInto<i32>,
N: TryInto<i32>,
MAX: TryInto<i32>,
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 Selfwhere
H: TryInto<i32>,
N: TryInto<i32>,
MAX: TryInto<i32>,
pub fn bar_vertical_with_z<H, N, MAX>(
&mut self,
pos: Point,
height: H,
n: N,
max: MAX,
color: ColorPair,
z: u32
) -> &mut Selfwhere
H: TryInto<i32>,
N: TryInto<i32>,
MAX: TryInto<i32>,
Draw a horizontal progress bar
sourcepub fn set_clipping(&mut self, clip: Option<Rect>) -> &mut Self
pub fn set_clipping(&mut self, clip: Option<Rect>) -> &mut Self
Sets a clipping rectangle for the current console
sourcepub fn set_all_fg_alpha(&mut self, alpha: f32) -> &mut Self
pub fn set_all_fg_alpha(&mut self, alpha: f32) -> &mut Self
Apply an alpha channel value to all cells’ foregrounds in the current terminal.
sourcepub fn set_all_bg_alpha(&mut self, alpha: f32) -> &mut Self
pub fn set_all_bg_alpha(&mut self, alpha: f32) -> &mut Self
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 Self
pub fn set_all_alpha(&mut self, fg: f32, bg: f32) -> &mut Self
Apply fg/bg alpha channel values to all cells in the current terminal.