MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / text

Method text

src/lib.rs:499–504  ·  view source on GitHub ↗

Adds a text element to the current open element or to the root layout.

(&mut self, text: &str, config_fn: impl FnOnce(&mut TextConfig) -> &mut TextConfig)

Source from the content-addressed store, hash-verified

497
498 /// Adds a text element to the current open element or to the root layout.
499 pub fn text(&mut self, text: &str, config_fn: impl FnOnce(&mut TextConfig) -> &mut TextConfig) {
500 let mut config = TextConfig::new();
501 config_fn(&mut config);
502 let text_config_index = self.ply.context.store_text_element_config(config);
503 self.ply.context.open_text_element(text, text_config_index);
504 }
505
506 /// Returns the current scroll offset of the open scroll container.
507 pub fn scroll_offset(&self) -> Vector2 {

Callers 4

test_beginFunction · 0.45
test_exampleFunction · 0.45
test_floatingFunction · 0.45
test_simple_text_measureFunction · 0.45

Calls 2

open_text_elementMethod · 0.80

Tested by 4

test_beginFunction · 0.36
test_exampleFunction · 0.36
test_floatingFunction · 0.36
test_simple_text_measureFunction · 0.36