pub struct Interface { /* private fields */ }
Implementations§
source§impl Interface
impl Interface
sourcepub fn default_font(&self) -> Option<(String, ImtWeight)>
pub fn default_font(&self) -> Option<(String, ImtWeight)>
Returns the default font used currently.
Notes
- If
built_in_font
feature is not enabled andset_default_font
has not been called this will beNone
.
sourcepub fn set_default_font<F: Into<String>>(
&self,
family: F,
weight: ImtWeight
) -> Result<(), String>
pub fn set_default_font<F: Into<String>>( &self, family: F, weight: ImtWeight ) -> Result<(), String>
Set the default font family and weight.
pub fn has_font<F: AsRef<str>>(&self, family: F, weight: ImtWeight) -> bool
sourcepub fn add_font<F: AsRef<str>>(
&self,
family: F,
weight: ImtWeight,
bytes: Vec<u8>
) -> Result<(), ImtError>
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.
sourcepub fn current_scale(&self) -> f32
pub fn current_scale(&self) -> f32
The current scale without taking into account dpi based window scaling.
sourcepub fn current_effective_scale(&self) -> f32
pub fn current_effective_scale(&self) -> f32
The current scale taking into account dpi based window scaling.
sourcepub fn set_scale(&self, set_scale: f32)
pub fn set_scale(&self, set_scale: f32)
Set the current scale. Doesn’t account for dpi based window scaling.
sourcepub fn set_effective_scale(&self, set_scale: f32)
pub fn set_effective_scale(&self, set_scale: f32)
Set the current scale taking into account dpi based window scaling.
sourcepub fn current_msaa(&self) -> BstMSAALevel
pub fn current_msaa(&self) -> BstMSAALevel
Get the current MSAA level.
sourcepub fn set_msaa(&self, set_msaa: BstMSAALevel)
pub fn set_msaa(&self, set_msaa: BstMSAALevel)
Set the MSAA Level.
sourcepub fn increase_msaa(&self) -> BstMSAALevel
pub fn increase_msaa(&self) -> BstMSAALevel
Increase MSAA to the next step.
sourcepub fn decrease_msaa(&self) -> BstMSAALevel
pub fn decrease_msaa(&self) -> BstMSAALevel
Decrease MSAA to the next step.
pub fn get_bin_id_atop( &self, window: BstWindowID, x: f32, y: f32 ) -> Option<BinID>
pub fn get_bin_atop( &self, window: BstWindowID, x: f32, y: f32 ) -> Option<Arc<Bin>>
sourcepub fn get_bins_atop(
&self,
_window: BstWindowID,
x: f32,
y: f32
) -> Vec<Arc<Bin>>
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.
sourcepub fn get_bin_ids_atop(
&self,
window: BstWindowID,
x: f32,
y: f32
) -> Vec<BinID>
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.
sourcepub fn bins(&self) -> Vec<Arc<Bin>>
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.
pub fn new_bins(&self, amt: usize) -> Vec<Arc<Bin>>
pub fn new_bin(&self) -> Arc<Bin>
pub fn get_bin(&self, id: BinID) -> Option<Arc<Bin>>
sourcepub fn mouse_inside(
&self,
_window: BstWindowID,
mouse_x: f32,
mouse_y: f32
) -> bool
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.