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)
| 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 { |