Crates.io | egui_drag_value_expr |
lib.rs | egui_drag_value_expr |
version | 0.1.1 |
source | src |
created_at | 2024-06-02 02:25:06.627949 |
updated_at | 2024-06-02 02:30:41.531682 |
description | An egui DragValue widget modified to accept a math expression as input. |
homepage | |
repository | https://github.com/cvhammond/egui_drag_value_expr |
max_upload_size | |
id | 1258978 |
size | 110,442 |
An egui DragValue widget that accepts expression-based values.
A rhai::Scope can be passed to the DragValueExpr widget to allow the user to enter expressions that reference variables in the scope.
With a scope:
let mut scope = rhai::Scope::new();
scope.push("ten", 10.);
ui.add(DragValueExpr::new(&mut self.value, Some(&scope)));
Without a scope:
ui.add(DragValueExpr::new(&mut self.value, None));
PRs, feature requests, and issues are welcome!