[−]Struct rltk::DrawBatch
Represents a batch of drawing commands, designed to be submitted together.
Methods
impl DrawBatch
pub fn new() -> Reusable<'static, DrawBatch>
Obtain a new, empty draw batch
pub fn submit(
&mut self,
z_order: usize
) -> Result<(), Box<dyn Error + 'static + Send + Sync>>
&mut self,
z_order: usize
) -> Result<(), Box<dyn Error + 'static + Send + Sync>>
Submits a batch to the global drawing buffer, and empties the batch.
pub fn cls(&mut self) -> &mut DrawBatch
Adds a CLS (clear screen) to the drawing batch
pub fn cls_color<COLOR>(&mut self, color: COLOR) -> &mut DrawBatch where
COLOR: Into<RGBA>,
COLOR: Into<RGBA>,
Adds a CLS (clear screen) to the drawing batch
pub fn target(&mut self, console: usize) -> &mut DrawBatch
Sets the target console for rendering
pub fn set<G>(
&mut self,
pos: Point,
color: ColorPair,
glyph: G
) -> &mut DrawBatch where
G: TryInto<u16>,
&mut self,
pos: Point,
color: ColorPair,
glyph: G
) -> &mut DrawBatch where
G: TryInto<u16>,
Sets an individual cell glyph
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>,
G: TryInto<u16>,
Z: TryInto<i32>,
&mut self,
position: Vec2,
z_order: Z,
rotation: ANGLE,
scale: Vec2,
color: ColorPair,
glyph: G
) -> &mut DrawBatch where
ANGLE: Into<Radians>,
G: TryInto<u16>,
Z: TryInto<i32>,
Pushes a fancy terminal character
pub fn set_bg<COLOR>(&mut self, pos: Point, bg: COLOR) -> &mut DrawBatch where
COLOR: Into<RGBA>,
COLOR: Into<RGBA>,
Sets an individual cell glyph
pub fn printer<S>(
&mut self,
pos: Point,
text: S,
align: TextAlign,
background: Option<RGBA>
) -> &mut DrawBatch where
S: ToString,
&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"
pub fn print<S>(&mut self, pos: Point, text: S) -> &mut DrawBatch where
S: ToString,
S: ToString,
Prints text in the default colors at a given location
pub fn print_color<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair
) -> &mut DrawBatch where
S: ToString,
&mut self,
pos: Point,
text: S,
color: ColorPair
) -> &mut DrawBatch where
S: ToString,
Prints text in the default colors at a given location
pub fn print_centered<S, Y>(&mut self, y: Y, text: S) -> &mut DrawBatch where
S: ToString,
Y: TryInto<i32>,
S: ToString,
Y: TryInto<i32>,
Prints text, centered to the whole console width, at vertical location y.
pub fn print_color_centered<S, Y>(
&mut self,
y: Y,
text: S,
color: ColorPair
) -> &mut DrawBatch where
S: ToString,
Y: TryInto<i32>,
&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.
pub fn print_centered_at<S>(&mut self, pos: Point, text: S) -> &mut DrawBatch where
S: ToString,
S: ToString,
Prints text, centered to the whole console width, at vertical location y.
pub fn print_color_centered_at<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair
) -> &mut DrawBatch where
S: ToString,
&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.
pub fn print_right<S>(&mut self, pos: Point, text: S) -> &mut DrawBatch where
S: ToString,
S: ToString,
Prints right aligned text
pub fn print_color_right<S>(
&mut self,
pos: Point,
text: S,
color: ColorPair
) -> &mut DrawBatch where
S: ToString,
&mut self,
pos: Point,
text: S,
color: ColorPair
) -> &mut DrawBatch where
S: ToString,
Prints right aligned text
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
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
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
pub fn draw_hollow_double_box(
&mut self,
pos: Rect,
color: ColorPair
) -> &mut DrawBatch
&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
pub fn fill_region<G>(
&mut self,
pos: Rect,
color: ColorPair,
glyph: G
) -> &mut DrawBatch where
G: TryInto<u16>,
&mut self,
pos: Rect,
color: ColorPair,
glyph: G
) -> &mut DrawBatch where
G: TryInto<u16>,
Fills a region with a glyph/color combination.
pub fn bar_horizontal<W, N, MAX>(
&mut self,
pos: Point,
width: W,
n: N,
max: MAX,
color: ColorPair
) -> &mut DrawBatch where
MAX: TryInto<i32>,
N: TryInto<i32>,
W: TryInto<i32>,
&mut self,
pos: Point,
width: W,
n: N,
max: MAX,
color: ColorPair
) -> &mut DrawBatch where
MAX: TryInto<i32>,
N: TryInto<i32>,
W: TryInto<i32>,
Draw a horizontal progress bar
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>,
MAX: TryInto<i32>,
N: TryInto<i32>,
&mut self,
pos: Point,
height: H,
n: N,
max: MAX,
color: ColorPair
) -> &mut DrawBatch where
H: TryInto<i32>,
MAX: TryInto<i32>,
N: TryInto<i32>,
Draw a horizontal progress bar
pub fn set_clipping(&mut self, clip: Option<Rect>) -> &mut DrawBatch
Sets a clipping rectangle for the current console
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.
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.
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
impl RefUnwindSafe for DrawBatch
impl Send for DrawBatch
impl Sync for DrawBatch
impl Unpin for DrawBatch
impl UnwindSafe for DrawBatch
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,