Skip to main content

View

Struct View 

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

Root of a scene. Origin is the center of the frame, y points down.

Implementations§

Source§

impl View

Source

pub fn current() -> Self

The view of the scene being executed.

Source

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

Frame size in pixels.

Source

pub fn is_portrait(self) -> bool

True when the frame is taller than it is wide.

Source

pub fn safe_area(self) -> SafeArea

The rectangle Node::to_edge pins to, in scene coordinates. A portrait frame leaves room for a vertical video’s status bar and buttons.

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 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 View

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 View

Source§

impl Debug for View

Source§

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

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

impl Deref for View

Source§

type Target = Node

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Node

Dereferences the value.
Source§

impl Eq for View

Source§

impl From<View> for Node

Source§

fn from(v: View) -> Node

Converts to this type from the input type.
Source§

impl PartialEq for View

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 View

Auto Trait Implementations§

§

impl Freeze for View

§

impl RefUnwindSafe for View

§

impl Send for View

§

impl Sync for View

§

impl Unpin for View

§

impl UnsafeUnpin for View

§

impl UnwindSafe for View

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