Struct ZeroHeapUiCanvas
pub struct ZeroHeapUiCanvas {
pub widget_count: usize,
pub widgets: [UiWidget; 512],
pub clip_rects: [[f32; 4]; 512],
pub wire_count: usize,
pub wires: [NodeWire; 64],
pub text_quad_count: usize,
pub text_quads: [MsdfTextQuad; 512],
pub active_focus_id: Option<u32>,
}Expand description
Fixed-capacity declarative UI canvas (upgraded to 512 Flexbox/Grid widgets + MSDF text runs).
Fields§
§widget_count: usize§widgets: [UiWidget; 512]§clip_rects: [[f32; 4]; 512]§wire_count: usize§wires: [NodeWire; 64]§text_quad_count: usize§text_quads: [MsdfTextQuad; 512]§active_focus_id: Option<u32>Implementations§
§impl ZeroHeapUiCanvas
impl ZeroHeapUiCanvas
pub fn clear(&mut self)
pub fn clear(&mut self)
Clears the canvas for the next frame.
pub fn apply_layout_tree(&mut self, tree: &ZeroHeapUiLayoutTree)
pub fn apply_layout_tree(&mut self, tree: &ZeroHeapUiLayoutTree)
Synchronizes resolved ComputedUiRects from a solved ZeroHeapUiLayoutTree directly into
existing widgets (matched by widget_id) or appends new glassmorphic panels.
pub fn add_text_run(
&mut self,
text: &str,
x: f32,
y: f32,
font_size_px: f32,
max_width_px: f32,
color: [f32; 4],
) -> ShapedTextRunMetrics
pub fn add_text_run( &mut self, text: &str, x: f32, y: f32, font_size_px: f32, max_width_px: f32, color: [f32; 4], ) -> ShapedTextRunMetrics
Shapes a UTF-8 text run into GPU MSDF glyph quads and appends them to self.text_quads in zero heap.
pub fn add_panel(&mut self, id: u32, rect: Rect2D, corner_radius: f32) -> bool
pub fn add_panel(&mut self, id: u32, rect: Rect2D, corner_radius: f32) -> bool
Adds a panel container widget.
Adds a push button widget.
pub fn add_slider(
&mut self,
id: u32,
rect: Rect2D,
value: f32,
min: f32,
max: f32,
) -> bool
pub fn add_slider( &mut self, id: u32, rect: Rect2D, value: f32, min: f32, max: f32, ) -> bool
Adds a slider widget.
pub fn add_wire(
&mut self,
start_pin: u32,
end_pin: u32,
p0: [f32; 2],
p3: [f32; 2],
color: [f32; 4],
) -> bool
pub fn add_wire( &mut self, start_pin: u32, end_pin: u32, p0: [f32; 2], p3: [f32; 2], color: [f32; 4], ) -> bool
Adds a cubic bezier wire between two node graph pins.
pub fn hit_test(&self, px: f32, py: f32) -> Option<u32>
pub fn hit_test(&self, px: f32, py: f32) -> Option<u32>
Evaluates pointer hit test, returning topmost widget ID under (px, py).
pub fn on_pointer_move(&mut self, px: f32, py: f32)
pub fn on_pointer_move(&mut self, px: f32, py: f32)
Dispatches pointer move event to update hover states.
Trait Implementations§
§impl Clone for ZeroHeapUiCanvas
impl Clone for ZeroHeapUiCanvas
§fn clone(&self) -> ZeroHeapUiCanvas
fn clone(&self) -> ZeroHeapUiCanvas
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ZeroHeapUiCanvas
§impl Debug for ZeroHeapUiCanvas
impl Debug for ZeroHeapUiCanvas
§impl Default for ZeroHeapUiCanvas
impl Default for ZeroHeapUiCanvas
§fn default() -> ZeroHeapUiCanvas
fn default() -> ZeroHeapUiCanvas
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ZeroHeapUiCanvas
impl RefUnwindSafe for ZeroHeapUiCanvas
impl Send for ZeroHeapUiCanvas
impl Sync for ZeroHeapUiCanvas
impl Unpin for ZeroHeapUiCanvas
impl UnsafeUnpin for ZeroHeapUiCanvas
impl UnwindSafe for ZeroHeapUiCanvas
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.