[][src]Struct vxdraw::text::Texts

pub struct Texts<'a> { /* fields omitted */ }

Accessor object to all text

Methods

impl<'a> Texts<'a>[src]

pub fn new(vx: &'a mut VxDraw) -> Self[src]

Prepare to edit text

You're not supposed to use this function directly (although you can). The recommended way of spawning a text is via VxDraw::text().

pub fn layer_count(&self) -> usize[src]

Query the amount of layers of this type there are

pub fn add_layer(&mut self, font: &'static [u8], options: LayerOptions) -> Layer[src]

Add a text layer to the system

pub fn remove_layer(&mut self, layer: Layer)[src]

Remove a layer

pub fn add(&mut self, layer: &Layer, string: &str, opts: TextOptions) -> Handle[src]

Add text to this layer

pub fn get_width(&self, handle: &Handle) -> f32[src]

Get the width of the text in native -1..1 coordinates

The width is in screen coordinates without considering scaling or translation effects. The width is just the modelspace width.

pub fn get_height(&self, handle: &Handle) -> f32[src]

Get the height of the text in native -1..1 coordinates

The height is in screen coordinates without considering scaling or translation effects. The height is just the modelspace height.

pub fn get_glyph_count(&self, handle: &Handle) -> usize[src]

Get the amount of glyphs for this handle

pub fn set_translation(&mut self, handle: &Handle, translation: (f32, f32))[src]

Set the scale of the text segment

pub fn set_scale(&mut self, handle: &Handle, scale: f32)[src]

Set the scale of the text segment

pub fn set_opacity(&mut self, handle: &Handle, opacity: u8)[src]

Set the opacity of a text segment

pub fn set_rotation<T: Copy + Into<Rad<f32>>>(
    &mut self,
    handle: &Handle,
    angle: T
)
[src]

Set the rotation of the text segment as a whole

pub fn set_opacity_glyphs(
    &mut self,
    handle: &Handle,
    delta: impl FnMut(usize) -> u8
)
[src]

Set the opacity on a per-glyph basis. Glyphs are enumerated as they would in a string

pub fn set_translation_glyphs(
    &mut self,
    handle: &Handle,
    delta: impl FnMut(usize) -> (f32, f32)
)
[src]

Set the rotation of the text segment as a whole

Auto Trait Implementations

impl<'a> Unpin for Texts<'a>

impl<'a> !Sync for Texts<'a>

impl<'a> !Send for Texts<'a>

impl<'a> !UnwindSafe for Texts<'a>

impl<'a> !RefUnwindSafe for Texts<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Supports<T> for T[src]

impl<T> SetParameter for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,