Struct DrawBatch

Source
pub struct DrawBatch { /* private fields */ }
Expand description

Represents a batch of drawing commands, designed to be submitted together.

Implementations§

Source§

impl DrawBatch

Source

pub fn new() -> Reusable<'static, DrawBatch>

Obtain a new, empty draw batch

Source

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.

Source

pub fn cls(&mut self) -> &mut DrawBatch

Adds a CLS (clear screen) to the drawing batch

Source

pub fn cls_color<COLOR>(&mut self, color: COLOR) -> &mut DrawBatch
where COLOR: Into<RGBA>,

Adds a CLS (clear screen) to the drawing batch

Source

pub fn target(&mut self, console: usize) -> &mut DrawBatch

Sets the target console for rendering

Source

pub fn set<G>( &mut self, pos: Point, color: ColorPair, glyph: G, ) -> &mut DrawBatch
where G: TryInto<u16>,

Sets an individual cell glyph

Source

pub fn set_with_z<G>( &mut self, pos: Point, color: ColorPair, glyph: G, z: u32, ) -> &mut DrawBatch
where G: TryInto<u16>,

Sets an individual cell glyph with a specified ordering within the batch

Source

pub fn set_fancy<ANGLE, Z, G>( &mut self, position: Vec2, z_order: Z, rotation: ANGLE, scale: Vec2, color: ColorPair, glyph: G, ) -> &mut DrawBatch
where ANGLE: Into<Radians>, Z: TryInto<i32>, G: TryInto<u16>,

Pushes a fancy terminal character

Source

pub fn set_bg<COLOR>(&mut self, pos: Point, bg: COLOR) -> &mut DrawBatch
where COLOR: Into<RGBA>,

Sets an individual cell glyph

Source

pub fn set_bg_with_z<COLOR>( &mut self, pos: Point, bg: COLOR, z: u32, ) -> &mut DrawBatch
where COLOR: Into<RGBA>,

Sets an individual cell glyph with specified render order

Source

pub fn printer<S>( &mut self, pos: Point, text: S, align: TextAlign, background: Option<RGBA>, ) -> &mut DrawBatch
where S: ToString,

Prints formatted text, using the doryen_rs convention. For example: “#[blue]This blue text contains a #[pink]pink#[] word”

Source

pub fn printer_with_z<S>( &mut self, pos: Point, text: S, align: TextAlign, background: Option<RGBA>, z: u32, ) -> &mut DrawBatch
where 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.

Source

pub fn print<S>(&mut self, pos: Point, text: S) -> &mut DrawBatch
where S: ToString,

Prints text in the default colors at a given location

Source

pub fn print_with_z<S>(&mut self, pos: Point, text: S, z: u32) -> &mut DrawBatch
where S: ToString,

Prints text in the default colors at a given location & render order

Source

pub fn print_color<S>( &mut self, pos: Point, text: S, color: ColorPair, ) -> &mut DrawBatch
where S: ToString,

Prints text in the default colors at a given location

Source

pub fn print_color_with_z<S>( &mut self, pos: Point, text: S, color: ColorPair, z: u32, ) -> &mut DrawBatch
where S: ToString,

Prints text in the default colors at a given location & render order

Source

pub fn print_centered<S, Y>(&mut self, y: Y, text: S) -> &mut DrawBatch
where S: ToString, Y: TryInto<i32>,

Prints text, centered to the whole console width, at vertical location y.

Source

pub fn print_centered_with_z<S, Y>( &mut self, y: Y, text: S, z: u32, ) -> &mut DrawBatch
where S: ToString, Y: TryInto<i32>,

Prints text, centered to the whole console width, at vertical location y.

Source

pub fn print_color_centered<S, Y>( &mut self, y: Y, text: S, color: ColorPair, ) -> &mut DrawBatch
where S: ToString, Y: TryInto<i32>,

Prints text, centered to the whole console width, at vertical location y.

Source

pub fn print_color_centered_with_z<S, Y>( &mut self, y: Y, text: S, color: ColorPair, z: u32, ) -> &mut DrawBatch
where S: ToString, Y: TryInto<i32>,

Prints text, centered to the whole console width, at vertical location y.

Source

pub fn print_centered_at<S>(&mut self, pos: Point, text: S) -> &mut DrawBatch
where S: ToString,

Prints text, centered to the whole console width, at vertical location y.

Source

pub fn print_centered_at_with_z<S>( &mut self, pos: Point, text: S, z: u32, ) -> &mut DrawBatch
where S: ToString,

Prints text, centered to the whole console width, at vertical location y with render order.

Source

pub fn print_color_centered_at<S>( &mut self, pos: Point, text: S, color: ColorPair, ) -> &mut DrawBatch
where S: ToString,

Prints text, centered to the whole console width, at vertical location y.

Source

pub fn print_color_centered_at_with_z<S>( &mut self, pos: Point, text: S, color: ColorPair, z: u32, ) -> &mut DrawBatch
where S: ToString,

Prints text, centered to the whole console width, at vertical location y with render order.

Source

pub fn print_right<S>(&mut self, pos: Point, text: S) -> &mut DrawBatch
where S: ToString,

Prints right aligned text

Source

pub fn print_right_z<S>( &mut self, pos: Point, text: S, z: u32, ) -> &mut DrawBatch
where S: ToString,

Prints right aligned text with render order

Source

pub fn print_color_right<S>( &mut self, pos: Point, text: S, color: ColorPair, ) -> &mut DrawBatch
where S: ToString,

Prints right aligned text

Source

pub fn print_color_right_with_z<S>( &mut self, pos: Point, text: S, color: ColorPair, z: u32, ) -> &mut DrawBatch
where S: ToString,

Prints right aligned text with render order

Source

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

Source

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.

Source

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

Source

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.

Source

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

Source

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

Source

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

Source

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

Source

pub fn fill_region<G>( &mut self, pos: Rect, color: ColorPair, glyph: G, ) -> &mut DrawBatch
where G: TryInto<u16>,

Fills a region with a glyph/color combination.

Source

pub fn fill_region_with_z<G>( &mut self, pos: Rect, color: ColorPair, glyph: G, z: u32, ) -> &mut DrawBatch
where G: TryInto<u16>,

Fills a region with a glyph/color combination.

Source

pub fn bar_horizontal<W, N, MAX>( &mut self, pos: Point, width: W, n: N, max: MAX, color: ColorPair, ) -> &mut DrawBatch
where W: TryInto<i32>, N: TryInto<i32>, MAX: TryInto<i32>,

Draw a horizontal progress bar

Source

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
where W: TryInto<i32>, N: TryInto<i32>, MAX: TryInto<i32>,

Draw a horizontal progress bar

Source

pub fn bar_vertical<H, N, MAX>( &mut self, pos: Point, height: H, n: N, max: MAX, color: ColorPair, ) -> &mut DrawBatch
where H: TryInto<i32>, N: TryInto<i32>, MAX: TryInto<i32>,

Draw a horizontal progress bar

Source

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
where H: TryInto<i32>, N: TryInto<i32>, MAX: TryInto<i32>,

Draw a horizontal progress bar

Source

pub fn set_clipping(&mut self, clip: Option<Rect>) -> &mut DrawBatch

Sets a clipping rectangle for the current console

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.