Skip to main content

Frame

Struct Frame 

Source
pub struct Frame<'p, P: Painter> { /* private fields */ }

Implementations§

Source§

impl<'p, P: Painter> Frame<'p, P>

Source

pub fn label(&mut self, tx: u32, ty: u32, text: &str, color: impl Into<Rgba>)

Source

pub fn cursor_at(&mut self, tx: u32, ty: u32, color: impl Into<Rgba>)

Source

pub fn cursor_glyph_at( &mut self, tx: u32, ty: u32, glyph: char, color: impl Into<Rgba>, )

Source

pub fn abs_glyph( &mut self, tx: u32, ty: u32, glyph: char, color: impl Into<Rgba>, )

Draw a glyph at a screen-absolute tile position. Bypasses the frame origin so the glyph appears at the requested column/row regardless of where the enclosing text_box is placed. Useful for cursors that sit at the border edge of a box (where frame-relative coordinates would be negative and thus inexpressible as u32).

Source

pub fn menu_list( &mut self, tx: u32, ty: u32, items: &[&str], cursor: usize, row_step: u32, color: impl Into<Rgba>, )

Source

pub fn pixel_rect( &mut self, dx_px: u32, dy_px: u32, w_px: u32, h_px: u32, color: impl Into<Rgba>, )

Source

pub fn sub_text_box<F>( &mut self, rect: TileRect, color: impl Into<Rgba>, body: F, )
where F: FnOnce(&mut Frame<'_, P>),

Source

pub fn gb_tile( &mut self, tx: u32, ty: u32, tile_id: u8, fallback: &str, color: impl Into<Rgba>, )

Source

pub fn bracket_box( &mut self, rect: TileRect, sides: BracketSides, with_arrow: bool, color: impl Into<Rgba>, )

Draws a partial border (one or more sides) inside the tile rect rect. Pixel offsets match the interior corner of the GB box-drawing glyphs (+6 on the right of a tile column, +6 on the bottom of a tile row), so the bracket aligns exactly with text_box borders.

If with_arrow is true, draws a 4px halfarrow (<) at the far-left of the bottom edge — matching original DrawLineBox terminator. Requires sides.bottom = true.

Source

pub fn vline( &mut self, tx: u32, ty: u32, length_tiles: u32, color: impl Into<Rgba>, )

1-pixel-wide vertical line at the right interior edge of tile column tx, spanning length_tiles tile rows starting at ty.

Source

pub fn hline( &mut self, tx: u32, ty: u32, length_tiles: u32, color: impl Into<Rgba>, )

1-pixel-tall horizontal line at the bottom interior edge of tile row ty, spanning length_tiles tile columns starting at tx.

Source

pub fn label_value_grid( &mut self, tx: u32, ty: u32, rows: &[LabelValue<'_>], value_indent_x: u32, row_step: u32, label_color: impl Into<Rgba>, value_color: impl Into<Rgba>, )

Draws a vertical sequence of label-value pairs starting at tile (tx, ty). Each pair places label at (tx, row) and value at (tx + value_indent_x, row + 1), advancing by row_step tile rows.

Auto Trait Implementations§

§

impl<'p, P> !UnwindSafe for Frame<'p, P>

§

impl<'p, P> Freeze for Frame<'p, P>

§

impl<'p, P> RefUnwindSafe for Frame<'p, P>
where P: RefUnwindSafe,

§

impl<'p, P> Send for Frame<'p, P>
where P: Send,

§

impl<'p, P> Sync for Frame<'p, P>
where P: Sync,

§

impl<'p, P> Unpin for Frame<'p, P>

§

impl<'p, P> UnsafeUnpin for Frame<'p, P>

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.