Skip to main content

CodeWindowBuilder

Struct CodeWindowBuilder 

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

Implementations§

Source§

impl CodeWindowBuilder

Source

pub fn source(self, code: impl Into<String>) -> Self

Set the source code of the code window

Source

pub fn font_family(self, family: impl Into<String>) -> Self

Set the font family of the code window

Source

pub const fn font_size(self, size: f32) -> Self

Set the font size of the code window

Source

pub const fn syntax(self, syntax: Syntax) -> Self

Set the syntax highlighting language of the code window

Source

pub fn theme(self, theme: Theme) -> Self

Set the theme of the code window

Source

pub fn title(self, title: impl Into<String>) -> Self

Set the title of the code window

Source

pub const fn title_font_size(self, size: f32) -> Self

Set the title font size

Source

pub const fn width(self, width: f32) -> Self

Set the width of the code window

Source

pub const fn height(self, height: f32) -> Self

Set the height of the code window

Source

pub const fn background_color(self, color: Color) -> Self

Set the background color of the code window

Source

pub const fn line_numbers(self, show: bool) -> Self

Toggle line numbers in the code window

Source

pub fn build(self) -> CodeWindowHandle

Source§

impl CodeWindowBuilder

Source

pub const fn pos(self, position: Vec2) -> Self

Set the 2D position of this object’s transform

Source

pub const fn z(self, z: f32) -> Self

Set the z position of this object’s transform. It’s used for ordering object drawing.

Source

pub const fn scale(self, scale: Vec2) -> Self

Set the scale of this object’s transform

Source

pub const fn rot(self, rotation: f32) -> Self

Set the rotation of this object’s transform

Trait Implementations§

Source§

impl Default for CodeWindowBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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.