pub struct Clay { /* private fields */ }Implementations§
Source§impl Clay
impl Clay
pub fn begin<'render, ImageElementData: 'render, CustomElementData: 'render>( &mut self, ) -> ClayLayoutScope<'_, 'render, ImageElementData, CustomElementData>
pub fn new(dimensions: Dimensions) -> Self
Sourcepub fn required_memory_size() -> usize
pub fn required_memory_size() -> usize
Wrapper for Clay_MinMemorySize, returns the minimum required memory by clay
Sourcepub fn set_measure_text_function_user_data<'clay, F, T>(
&'clay mut self,
userdata: T,
callback: F,
)
pub fn set_measure_text_function_user_data<'clay, F, T>( &'clay mut self, userdata: T, callback: F, )
Set the callback for text measurement with user data
Sourcepub fn set_measure_text_function<F>(&mut self, callback: F)
pub fn set_measure_text_function<F>(&mut self, callback: F)
Set the callback for text measurement
Sourcepub 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,
)
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
Sourcepub fn max_element_count(&mut self, max_element_count: u32)
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
Sourcepub fn max_measure_text_cache_word_count(&self, count: u32)
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
Sourcepub fn set_debug_mode(&self, enable: bool)
pub fn set_debug_mode(&self, enable: bool)
Enables or disables the debug mode of clay
Sourcepub fn set_layout_dimensions(&self, dimensions: Dimensions)
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
Sourcepub fn pointer_state(&self, position: Vector2, is_down: bool)
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