Struct basalt::interface::Interface

source ·
pub struct Interface { /* private fields */ }

Implementations§

source§

impl Interface

source

pub fn default_font(&self) -> Option<(String, ImtWeight)>

Returns the default font used currently.

Notes
  • If built_in_font feature is not enabled and set_default_font has not been called this will be None.
source

pub fn set_default_font<F: Into<String>>( &self, family: F, weight: ImtWeight ) -> Result<(), String>

Set the default font family and weight.

source

pub fn has_font<F: AsRef<str>>(&self, family: F, weight: ImtWeight) -> bool

source

pub fn add_font<F: AsRef<str>>( &self, family: F, weight: ImtWeight, bytes: Vec<u8> ) -> Result<(), ImtError>

Add a font that is available to use.

Notes
  • Overwrites previous font if added with same family and weight.
  • This does not set the default font. Use set_default_font to do this.
source

pub fn current_scale(&self) -> f32

The current scale without taking into account dpi based window scaling.

source

pub fn current_effective_scale(&self) -> f32

The current scale taking into account dpi based window scaling.

source

pub fn set_scale(&self, set_scale: f32)

Set the current scale. Doesn’t account for dpi based window scaling.

source

pub fn set_effective_scale(&self, set_scale: f32)

Set the current scale taking into account dpi based window scaling.

source

pub fn current_msaa(&self) -> BstMSAALevel

Get the current MSAA level.

source

pub fn set_msaa(&self, set_msaa: BstMSAALevel)

Set the MSAA Level.

source

pub fn increase_msaa(&self) -> BstMSAALevel

Increase MSAA to the next step.

source

pub fn decrease_msaa(&self) -> BstMSAALevel

Decrease MSAA to the next step.

source

pub fn get_bin_id_atop( &self, window: BstWindowID, x: f32, y: f32 ) -> Option<BinID>

source

pub fn get_bin_atop( &self, window: BstWindowID, x: f32, y: f32 ) -> Option<Arc<Bin>>

source

pub fn get_bins_atop( &self, _window: BstWindowID, x: f32, y: f32 ) -> Vec<Arc<Bin>>

Get the Bin’s that are at the given mouse position accounting for current effective scale. Returned Vec is sorted where the top-most Bin’s are first.

source

pub fn get_bin_ids_atop( &self, window: BstWindowID, x: f32, y: f32 ) -> Vec<BinID>

Get the BinID’s that are at the given mouse position accounting for current effective scale. Returned Vec is sorted where the top-most Bin’s are first.

source

pub fn bins(&self) -> Vec<Arc<Bin>>

Returns a list of all bins that have a strong reference. Note keeping this list will keep all bins returned alive and prevent them from being dropped. This list should be dropped asap to prevent issues with bins being dropped.

source

pub fn new_bins(&self, amt: usize) -> Vec<Arc<Bin>>

source

pub fn new_bin(&self) -> Arc<Bin>

source

pub fn get_bin(&self, id: BinID) -> Option<Arc<Bin>>

source

pub fn mouse_inside( &self, _window: BstWindowID, mouse_x: f32, mouse_y: f32 ) -> bool

Checks if the mouse position is on top of any Bin’s in the interface.

source

pub fn draw( &self, cmd: AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>, target: ItfDrawTarget ) -> (AutoCommandBufferBuilder<PrimaryAutoCommandBuffer>, Option<Arc<BstImageView>>)

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.