Skip to main content

Canvas

Struct Canvas 

Source
pub struct Canvas { /* private fields */ }

Implementations§

Source§

impl Canvas

Source

pub const fn new(fg: RgbColor, bg: RgbColor) -> Self

Creates a new instance.

Source

pub fn set_fg(&mut self, fg: RgbColor)

Sets fg.

Source

pub fn set_bg(&mut self, bg: RgbColor)

Sets bg.

Source

pub fn set_colors(&mut self, fg: RgbColor, bg: RgbColor)

Sets colors.

Source

pub fn set_clip_rect(&self, x: usize, y: usize, w: usize, h: usize)

Sets clip rect.

Source

pub fn reset_clip_rect(&self)

Performs the reset clip rect operation.

Source

pub fn clear(&self)

Performs the clear operation.

Source

pub fn pixel(&self, x: usize, y: usize)

Performs the pixel operation.

Source

pub fn line(&self, x0: isize, y0: isize, x1: isize, y1: isize)

Performs the line operation.

Source

pub fn rect(&self, x: usize, y: usize, w: usize, h: usize)

Performs the rect operation.

Source

pub fn fill_rect(&self, x: usize, y: usize, w: usize, h: usize)

Performs the fill rect operation.

Source

pub fn fill_rect_alpha(&self, x: usize, y: usize, w: usize, h: usize, alpha: u8)

Performs the fill rect alpha operation.

Source

pub fn text(&self, x: usize, y: usize, text: &str)

Performs the text operation.

Source

pub fn text_opts( &self, x: usize, y: usize, text: &str, align: TextAlign, wrap: bool, max_width: Option<usize>, ) -> TextMetrics

Performs the text opts operation.

Source

pub fn measure_text( &self, text: &str, max_width: Option<usize>, wrap: bool, ) -> TextMetrics

Performs the measure text operation.

Source

pub fn blit_rgb( &self, x: usize, y: usize, w: usize, h: usize, pixels: &[RgbColor], ) -> bool

Performs the blit rgb operation.

Source

pub fn blit_rgb24( &self, x: usize, y: usize, w: usize, h: usize, bytes: &[u8], ) -> bool

Performs the blit rgb24 operation.

Source

pub fn blit_rgba( &self, x: usize, y: usize, w: usize, h: usize, bytes: &[u8], global_alpha: u8, ) -> bool

Performs the blit rgba operation.

Source

pub fn blit_sprite_rgba( &self, x: usize, y: usize, sprite: SpriteRgba<'_>, global_alpha: u8, ) -> bool

Performs the blit sprite rgba operation.

Source

pub fn begin_frame(&self) -> bool

Performs the begin frame operation.

Source

pub fn end_frame(&self)

Performs the end frame operation.

Source

pub fn ui_clear(&self, theme: UiTheme)

Performs the ui clear operation.

Source

pub fn ui_panel( &self, x: usize, y: usize, w: usize, h: usize, title: &str, body: &str, theme: UiTheme, )

Performs the ui panel operation.

Source

pub fn ui_status_bar(&self, left: &str, right: &str, theme: UiTheme)

Performs the ui status bar operation.

Source

pub fn system_status_line(&self, theme: UiTheme)

Performs the system status line operation.

Source

pub fn layout_screen(&self) -> UiDockLayout

Performs the layout screen operation.

Source

pub fn ui_label(&self, label: &UiLabel<'_>)

Performs the ui label operation.

Source

pub fn ui_progress_bar(&self, bar: UiProgressBar)

Performs the ui progress bar operation.

Source

pub fn ui_table(&self, table: &UiTable)

Performs the ui table operation.

Trait Implementations§

Source§

impl Clone for Canvas

Source§

fn clone(&self) -> Canvas

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Canvas

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Canvas

Source§

fn default() -> Self

Builds a default instance.

Source§

impl Copy for Canvas

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.