pub struct ShaderBuilder { /* private fields */ }Expand description
Builder for a Shader node.
Implementations§
Source§impl ShaderBuilder
impl ShaderBuilder
Sourcepub fn width(self, v: impl Into<Span>) -> Self
pub fn width(self, v: impl Into<Span>) -> Self
Width in pixels, or pct(100) for the whole frame.
Sourcepub fn height(self, v: impl Into<Span>) -> Self
pub fn height(self, v: impl Into<Span>) -> Self
Height in pixels, or a percentage of the frame.
Sourcepub fn fullscreen(self) -> Self
pub fn fullscreen(self) -> Self
Uses the frame as the box. Put the node on the view so a camera does not move it.
Sourcepub fn uniform(self, name: impl Into<String>, value: f64) -> Self
pub fn uniform(self, name: impl Into<String>, value: f64) -> Self
Sets a numeric Params field. A name that is not in the shader
fails check (param_unknown).
Sourcepub fn uniform_vec2(
self,
name: impl Into<String>,
value: impl Into<Vec2>,
) -> Self
pub fn uniform_vec2( self, name: impl Into<String>, value: impl Into<Vec2>, ) -> Self
Sets a vec2<f32> field from a point.
Sourcepub fn uniform_color(
self,
name: impl Into<String>,
value: impl IntoPaint,
) -> Self
pub fn uniform_color( self, name: impl Into<String>, value: impl IntoPaint, ) -> Self
Sets a vec4<f32> field from a color or a theme role such as Accent.
Sourcepub fn uniform_bool(self, name: impl Into<String>, value: bool) -> Self
pub fn uniform_bool(self, name: impl Into<String>, value: bool) -> Self
Sets a bool field.
Sourcepub fn amp(self, value: f64) -> Self
pub fn amp(self, value: f64) -> Self
Wave height, as a fraction of the box. The preset default is 0.05.
Sourcepub fn deep(self, value: impl IntoPaint) -> Self
pub fn deep(self, value: impl IntoPaint) -> Self
Color below the crest. A theme role such as Accent follows the theme.
Sourcepub fn input(self, name: impl Into<String>, input: Input) -> Self
pub fn input(self, name: impl Into<String>, input: Input) -> Self
Names what the shader reads. lens_drops reads "scene", which is
the frame drawn before it whether or not this is called. A name the
preset does not read fails check (param_unknown).
Sourcepub fn wetness(self, value: f64) -> Self
pub fn wetness(self, value: f64) -> Self
How many drops cover the lens of lens_drops, 0 to 1. The preset
default is 0.6; start from 0 to keep the lens dry until a splash.
Trait Implementations§
Source§impl NodeBuilder for ShaderBuilder
impl NodeBuilder for ShaderBuilder
Source§fn name(self, v: impl Into<String>) -> Self
fn name(self, v: impl Into<String>) -> Self
oxframe check / oxframe inspect.
Without it, the node is labeled by the add call site (src/main.rs:42).Source§fn position(self, v: impl Into<Vec2>) -> Self
fn position(self, v: impl Into<Vec2>) -> Self
x and y together, e.g. .position((100.0, -50.0)).Source§fn fill(self, v: impl IntoPaint) -> Self
fn fill(self, v: impl IntoPaint) -> Self
Color or a theme role such as Accent.
Default: transparent, except text, which uses the theme’s text color.Source§fn stroke(self, v: impl IntoPaint) -> Self
fn stroke(self, v: impl IntoPaint) -> Self
line_width. A theme role works the same as a color.
Default: transparent.Source§fn line_width(self, v: f64) -> Self
fn line_width(self, v: f64) -> Self
Source§fn start(self, v: f64) -> Self
fn start(self, v: f64) -> Self
Source§fn end(self, v: f64) -> Self
fn end(self, v: f64) -> Self
Source§fn fill_gradient(self, g: Gradient) -> Self
fn fill_gradient(self, g: Gradient) -> Self
fill.Source§fn stroke_gradient(self, g: Gradient) -> Self
fn stroke_gradient(self, g: Gradient) -> Self
stroke.Source§fn dash(self, pattern: impl Into<Vec<f64>>) -> Self
fn dash(self, pattern: impl Into<Vec<f64>>) -> Self
dash_offset for
marching ants.Source§fn dash_offset(self, v: f64) -> Self
fn dash_offset(self, v: f64) -> Self
Source§fn blur(self, v: f64) -> Self
fn blur(self, v: f64) -> Self
Source§fn shadow(
self,
color: impl IntoPaint,
blur: f64,
offset: impl Into<Vec2>,
) -> Self
fn shadow( self, color: impl IntoPaint, blur: f64, offset: impl Into<Vec2>, ) -> Self
Source§fn elevation(self, step: Step) -> Self
fn elevation(self, step: Step) -> Self
Xs and Sm are the small one, Xl the large).Source§fn anchor(self, v: impl Into<Vec2>) -> Self
fn anchor(self, v: impl Into<Vec2>) -> Self
Source§fn shrink(self, v: f64) -> Self
fn shrink(self, v: f64) -> Self
Layout: how much this node gives up when space is short.Source§fn margin(self, v: impl Len) -> Self
fn margin(self, v: impl Len) -> Self
Layout: space around this node, in pixels or a theme step (.margin(Md)).Source§fn align_self(self, v: LayoutAlign) -> Self
fn align_self(self, v: LayoutAlign) -> Self
Layout: overrides the layout’s cross-axis alignment.Source§fn next_to(self, other: impl Into<Node>, side: Side) -> Self
fn next_to(self, other: impl Into<Node>, side: Side) -> Self
other, on side. The gap is the theme’s Md
step. Recomputed every frame, so this node follows other.Source§fn align_to(self, other: impl Into<Node>, edge: Edge) -> Self
fn align_to(self, other: impl Into<Node>, edge: Edge) -> Self
edge up with the same edge of other.Source§fn to_edge(self, edge: Edge) -> Self
fn to_edge(self, edge: Edge) -> Self
x or y.Source§fn center_in(self, other: impl Into<Node>) -> Self
fn center_in(self, other: impl Into<Node>) -> Self
other. Pass the view to center in the frame.Source§fn child<C: NodeBuilder>(self, child: C) -> Self
fn child<C: NodeBuilder>(self, child: C) -> Self
Node::add when
you need the child’s handle.