pub struct ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData> { /* private fields */ }Implementations§
Source§impl<'render, 'clay: 'render, ImageElementData: 'render, CustomElementData: 'render> ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>
impl<'render, 'clay: 'render, ImageElementData: 'render, CustomElementData: 'render> ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>
Sourcepub fn with<F: FnOnce(&mut ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>)>(
&mut self,
declaration: &Declaration<'render, ImageElementData, CustomElementData>,
f: F,
)
pub fn with<F: FnOnce(&mut ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>)>( &mut self, declaration: &Declaration<'render, ImageElementData, CustomElementData>, f: F, )
Create an element, passing its config and a function to add childrens
pub fn with_styling<G: FnOnce(&ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>) -> Declaration<'render, ImageElementData, CustomElementData>, F: FnOnce(&ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>)>( &self, g: G, f: F, )
pub fn end( &mut self, ) -> impl Iterator<Item = RenderCommand<'render, ImageElementData, CustomElementData>>
Sourcepub fn id(&self, label: &'render str) -> Id
pub fn id(&self, label: &'render str) -> Id
Generates a unique ID based on the given label.
This ID is global and must be unique across the entire scope.
Sourcepub fn id_index(&self, label: &'render str, index: u32) -> Id
pub fn id_index(&self, label: &'render str, index: u32) -> Id
Generates a unique indexed ID based on the given label and index.
This is useful when multiple elements share the same label but need distinct IDs.
Sourcepub fn id_local(&self, label: &'render str) -> Id
pub fn id_local(&self, label: &'render str) -> Id
Generates a locally unique ID based on the given label.
The ID is unique within a specific local scope but not globally.
Sourcepub fn id_index_local(&self, label: &'render str, index: u32) -> Id
pub fn id_index_local(&self, label: &'render str, index: u32) -> Id
Generates a locally unique indexed ID based on the given label and index.
This is useful for differentiating elements within a local scope while keeping their labels consistent.
Sourcepub fn text(&self, text: &'render str, config: TextElementConfig)
pub fn text(&self, text: &'render str, config: TextElementConfig)
Adds a text element to the current open element or to the root layout
pub fn hovered(&self) -> bool
pub fn pointer_over(&self, cfg: Id) -> bool
pub fn scroll_container_data(&self, id: Id) -> Option<Clay_ScrollContainerData>
pub fn bounding_box(&self, id: Id) -> Option<BoundingBox>
pub fn scroll_offset(&self) -> Vector2
Trait Implementations§
Auto Trait Implementations§
impl<'clay, 'render, ImageElementData, CustomElementData> Freeze for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>
impl<'clay, 'render, ImageElementData, CustomElementData> RefUnwindSafe for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>where
ImageElementData: RefUnwindSafe,
CustomElementData: RefUnwindSafe,
impl<'clay, 'render, ImageElementData, CustomElementData> !Send for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>
impl<'clay, 'render, ImageElementData, CustomElementData> !Sync for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>
impl<'clay, 'render, ImageElementData, CustomElementData> Unpin for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>
impl<'clay, 'render, ImageElementData, CustomElementData> !UnwindSafe for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>
Blanket Implementations§
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