Skip to main content

Txt

Struct Txt 

Source
pub struct Txt(/* private fields */);
Expand description

Handle to a Txt node in the scene: cheap to copy, its methods return the node’s properties as Signals. Derefs to Node.

Implementations§

Source§

impl Txt

Source

pub fn new() -> TxtBuilder

Starts a builder; add it with Node::add (e.g. view.add(..)).

Source

pub fn node(self) -> Node

The untyped node handle (same as *self).

Source§

impl Txt

Source

pub fn text(self) -> Signal<String>

The text property as an animatable signal.

Source

pub fn spans(self) -> Signal<Vec<RichSpan>>

The spans property as an animatable signal.

Source

pub fn font_size(self) -> Signal<f64>

The font_size property as an animatable signal.

Source

pub fn weight(self) -> Signal<f64>

The weight property as an animatable signal.

Source§

impl Txt

Source

pub fn morph_to(self, text: impl Into<String>, duration: f64) -> BoxFuture

Morphs to text glyph by glyph: letters present in both strings travel to their new places, the others fade.

Methods from Deref<Target = Node>§

Source

pub fn id(self) -> NodeId

Index of the node in the scene graph.

Source

pub fn x(self) -> Signal<f64>

The x property as an animatable signal.

Source

pub fn y(self) -> Signal<f64>

The y property as an animatable signal.

Source

pub fn rotation(self) -> Signal<f64>

Degrees, clockwise.

The rotation property as an animatable signal.

Source

pub fn scale(self) -> Signal<Vec2>

The scale property as an animatable signal.

Source

pub fn opacity(self) -> Signal<f64>

The opacity property as an animatable signal.

Source

pub fn fill(self) -> Signal<Color>

The fill property as an animatable signal.

Source

pub fn stroke(self) -> Signal<Color>

The stroke property as an animatable signal.

Source

pub fn line_width(self) -> Signal<f64>

The line_width property as an animatable signal.

Source

pub fn start(self) -> Signal<f64>

Start of the drawn part of the outline (fraction of its length).

The start property as an animatable signal.

Source

pub fn end(self) -> Signal<f64>

End of the drawn part of the outline.

The end property as an animatable signal.

Source

pub fn fill_gradient(self) -> Signal<Option<Gradient>>

The fill_gradient property as an animatable signal.

Source

pub fn stroke_gradient(self) -> Signal<Option<Gradient>>

The stroke_gradient property as an animatable signal.

Source

pub fn dash(self) -> Signal<Vec<f64>>

The dash property as an animatable signal.

Source

pub fn dash_offset(self) -> Signal<f64>

The dash_offset property as an animatable signal.

Source

pub fn line_cap(self) -> Signal<LineCap>

The line_cap property as an animatable signal.

Source

pub fn line_join(self) -> Signal<LineJoin>

The line_join property as an animatable signal.

Source

pub fn blur(self) -> Signal<f64>

The blur property as an animatable signal.

Source

pub fn shadow_color(self) -> Signal<Color>

The shadow_color property as an animatable signal.

Source

pub fn shadow_blur(self) -> Signal<f64>

The shadow_blur property as an animatable signal.

Source

pub fn shadow_offset(self) -> Signal<Vec2>

The shadow_offset property as an animatable signal.

Source

pub fn clip(self) -> Signal<bool>

The clip property as an animatable signal.

Source

pub fn blend(self) -> Signal<BlendMode>

The blend property as an animatable signal.

Source

pub fn z_index(self) -> Signal<f64>

The z_index property as an animatable signal.

Source

pub fn anchor(self) -> Signal<Vec2>

The anchor property as an animatable signal.

Source

pub fn grow(self) -> Signal<f64>

The grow property as an animatable signal.

Source

pub fn shrink(self) -> Signal<f64>

The shrink property as an animatable signal.

Source

pub fn basis(self) -> Signal<Option<f64>>

The basis property as an animatable signal.

Source

pub fn margin(self) -> Signal<f64>

The margin property as an animatable signal.

Source

pub fn align_self(self) -> Signal<Option<LayoutAlign>>

The align_self property as an animatable signal.

Source

pub fn add<B: NodeBuilder>(self, child: B) -> B::Handle

Adds a child node; children are positioned relative to the parent.

The call site is stored on the node (oxframe check and oxframe inspect print it). .name("title") overrides the automatic label.

Source

pub fn remove(self)

Detaches the node from its parent; it stops being drawn.

Source

pub fn fade_in(self) -> Tween<f64> ⓘ

Fades the node in from transparent, over the theme’s normal duration with its enter easing.

Source

pub fn pop_in(self) -> Tween<Vec2> ⓘ

Grows the node from nothing to its current scale with a small overshoot (the theme’s emphasis easing, OUT_BACK by default).

Source

pub fn draw_on(self) -> Tween<f64> ⓘ

Draws the outline from start to end (end from 0 to 1), as if with a pen. Works on every shape with an outline: paths, lines, rectangles, circles, polygons.

Source

pub fn slide_in(self, from: Side) -> impl Future<Output = ()> + 'static

Slides the node into its place from SLIDE_DISTANCE pixels towards from, fading in on the way.

Source

pub fn next_to(self, other: impl Into<Node>, side: Side) -> Self

Sits just outside other. The gap is the theme’s Md step, and the position is recomputed every frame.

Source

pub fn align_to(self, other: impl Into<Node>, edge: Edge) -> Self

Lines this node’s edge up with the same edge of other.

Source

pub fn to_edge(self, edge: Edge) -> Self

Pins one edge to the safe area. The other axis is left as it is.

Source

pub fn center_in(self, other: impl Into<Node>) -> Self

Same center as other.

Source

pub fn fade_out(self) -> Tween<f64> ⓘ

Fades the node out, over the theme’s normal duration with its exit easing.

Source

pub fn reparent(self, parent: impl Into<Node>)

Moves the node under another parent.

Source

pub fn children(self) -> Vec<Node>

Direct children, in creation order.

Source

pub fn size(self) -> (f64, f64)

Size of the node’s box in its own coordinates.

Source

pub fn absolute_position(self) -> Vec2

Position of the node’s origin in scene coordinates.

Trait Implementations§

Source§

impl Clone for Txt

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Txt

Source§

impl Debug for Txt

Source§

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

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

impl Deref for Txt

Source§

type Target = Node

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Node

Dereferences the value.
Source§

impl Eq for Txt

Source§

impl From<Txt> for Node

Source§

fn from(h: Txt) -> Node

Converts to this type from the input type.
Source§

impl Hash for Txt

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Txt

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Txt

Auto Trait Implementations§

§

impl Freeze for Txt

§

impl RefUnwindSafe for Txt

§

impl Send for Txt

§

impl Sync for Txt

§

impl Unpin for Txt

§

impl UnsafeUnpin for Txt

§

impl UnwindSafe for Txt

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.
Source§

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

Source§

fn vzip(self) -> V