Clay

Struct Clay 

Source
pub struct Clay { /* private fields */ }

Implementations§

Source§

impl Clay

Source

pub fn begin<'render, ImageElementData: 'render, CustomElementData: 'render>( &mut self, ) -> ClayLayoutScope<'_, 'render, ImageElementData, CustomElementData>

Source

pub fn new(dimensions: Dimensions) -> Self

Source

pub fn required_memory_size() -> usize

Wrapper for Clay_MinMemorySize, returns the minimum required memory by clay

Source

pub fn set_measure_text_function_user_data<'clay, F, T>( &'clay mut self, userdata: T, callback: F, )
where F: Fn(&str, &TextConfig, &'clay mut T) -> Dimensions + 'static, T: 'clay,

Set the callback for text measurement with user data

Source

pub fn set_measure_text_function<F>(&mut self, callback: F)
where F: Fn(&str, &TextConfig) -> Dimensions + 'static,

Set the callback for text measurement

Source

pub unsafe fn set_measure_text_function_unsafe( callback: unsafe extern "C" fn(Clay_StringSlice, *mut Clay_TextElementConfig, *mut c_void) -> Clay_Dimensions, user_data: *mut c_void, )

Set the callback for text measurement with user data.

§Safety

This function is unsafe because it sets a callback function without any error checking

Source

pub fn max_element_count(&mut self, max_element_count: u32)

Sets the maximum number of element that clay supports Use only if you know what you are doing or your getting errors from clay

Source

pub fn max_measure_text_cache_word_count(&self, count: u32)

Sets the capacity of the cache used for text in the measure text function Use only if you know what you are doing or your getting errors from clay

Source

pub fn set_debug_mode(&self, enable: bool)

Enables or disables the debug mode of clay

Source

pub fn set_layout_dimensions(&self, dimensions: Dimensions)

Sets the dimensions of the global layout, use if, for example the window size you render to changed

Source

pub fn pointer_state(&self, position: Vector2, is_down: bool)

Updates the state of the pointer for clay. Used to update scroll containers and for interactions functions

Source

pub fn update_scroll_containers( &self, drag_scrolling_enabled: bool, scroll_delta: Vector2, delta_time: f32, )

Source

pub fn hovered(&self) -> bool

Returns if the current element you are creating is hovered

Source

pub fn pointer_over(&self, cfg: Id) -> bool

Source

pub fn bounding_box(&self, id: Id) -> Option<BoundingBox>

Source

pub fn scroll_container_data(&self, id: Id) -> Option<Clay_ScrollContainerData>

Trait Implementations§

Source§

impl Drop for Clay

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Clay

§

impl RefUnwindSafe for Clay

§

impl !Send for Clay

§

impl !Sync for Clay

§

impl Unpin for Clay

§

impl UnwindSafe for Clay

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.