pub struct Node {Show 24 fields
pub id: NodeId,
pub kind: Kind,
pub name: String,
pub x: f32,
pub y: f32,
pub width: Size,
pub height: Size,
pub opacity: f32,
pub on_click: Option<String>,
pub fill: Option<Fill>,
pub stroke: Option<Color>,
pub stroke_width: f32,
pub radius: [f32; 4],
pub shadow: Option<Shadow>,
pub clip: bool,
pub layout: Layout,
pub gap: f32,
pub padding: [f32; 4],
pub align: Align,
pub justify: Align,
pub text: Option<TextStyle>,
pub vector: Option<Vector>,
pub image: Option<Image>,
pub children: Children<Node>,
}Expand description
One node of a scene.
Fields§
§id: NodeIdWhere the node came from — see NodeId — which no edit around it
changes.
kind: KindWhat the node is.
name: StringThe node’s name: its name attribute, or else its element’s, as
problems call it.
x: f32How far right of its parent’s top-left the node sits, in pixels; only a parent with no auto layout places it by this.
y: f32How far down from its parent’s top-left the node sits, in pixels; only a parent with no auto layout places it by this.
width: SizeHow the node’s width is set.
height: SizeHow the node’s height is set.
opacity: f32How opaque the node and everything in it is, from 0 to 1.
on_click: Option<String>What a click on the node does: navigate <path>, back, overlay <path> or close, each path from the top of the served folder. None
when a click does nothing.
fill: Option<Fill>What the node’s box is filled with; None for nothing.
stroke: Option<Color>The color of the node’s outline; None for no outline.
stroke_width: f32How wide the outline is, in pixels.
radius: [f32; 4]Each corner’s radius, in pixels: top-left, top-right, bottom-right, bottom-left.
shadow: Option<Shadow>The node’s drop shadow; None for none.
clip: boolWhether a frame’s children are cut off at its box, rounded corners and all.
layout: LayoutHow a frame places its children.
gap: f32The space between a frame’s children in its auto layout, in pixels.
padding: [f32; 4]The space inside a frame’s edges, in pixels: top, right, bottom, left.
align: AlignWhere a frame’s auto layout puts its children across its direction.
justify: AlignWhere a frame’s auto layout puts its children along its direction.
text: Option<TextStyle>A Text’s text and how it is set; None for any other kind.
vector: Option<Vector>A Vector’s path; None for any other kind.
image: Option<Image>An Image’s file; None for any other kind.
children: Children<Node>The node’s children, in order.